当前位置: 首页>>代码示例>>Java>>正文


Java VKRequest.executeWithListener方法代码示例

本文整理汇总了Java中com.vk.sdk.api.VKRequest.executeWithListener方法的典型用法代码示例。如果您正苦于以下问题:Java VKRequest.executeWithListener方法的具体用法?Java VKRequest.executeWithListener怎么用?Java VKRequest.executeWithListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vk.sdk.api.VKRequest的用法示例。


在下文中一共展示了VKRequest.executeWithListener方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: call

import com.vk.sdk.api.VKRequest; //导入方法依赖的package包/类
@Override
public FREObject call( FREContext context, FREObject[] args ) {
	super.call( context, args );

	FREArray params = (args[1] != null) ? (FREArray) args[1] : null;
	VKParameters vkParameters = new VKParameters();
	String errorMessage = parseRequestParameters( params, vkParameters );

	mRequestId = FREObjectUtils.getInt( args[2] );
	/* Send request if there's no error parsing the parameters */
	if( errorMessage == null ) {
		String method = FREObjectUtils.getString( args[0] );
		/* Execute the request */
		AIR.log( "Sending VKRequest " + method );
		VKRequest request = new VKRequest( method );
		request.addExtraParameters( vkParameters );
		request.executeWithListener( getRequestListener( mRequestId ) );
	}
	/* Or dispatch error */
	else {
		AIR.log( "Error parsing request parameters: " + errorMessage );
		AIR.dispatchEvent( AIRVKEvent.VK_REQUEST_ERROR, StringUtils.getEventErrorJSON( mRequestId, errorMessage ) );
	}

	return null;
}
 
开发者ID:marpies,项目名称:vk-ane,代码行数:27,代码来源:RequestFunction.java

示例2: setPhoto

import com.vk.sdk.api.VKRequest; //导入方法依赖的package包/类
public void setPhoto(final ImageView imageView, final Button button){
    VKParameters params = new VKParameters();
    params.put(VKApiConst.FIELDS, "photo_max_orig");

    VKRequest request = new VKRequest("users.get",params);
    request.executeWithListener(new VKRequest.VKRequestListener() {

        @Override
        public void onComplete(VKResponse response) {
            super.onComplete(response);
            JSONArray resp = null;
            try {
                resp = response.json.getJSONArray("response");
                JSONObject user = resp.getJSONObject(0);
                String photo_max_orig_url = user.getString("photo_max_orig");
                imageView.setVisibility(View.VISIBLE);
                button.setVisibility(View.GONE);
                Glide.with(context).load(photo_max_orig_url).into(imageView);
            } catch (JSONException e) {
                Log.d("VkSdkHelper", String.valueOf(e));
            }
            }

        @Override
        public void onError(VKError error) {
            super.onError(error);
        }
    });
}
 
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:30,代码来源:VkSdkHelper.java

示例3: notificationBlock

import com.vk.sdk.api.VKRequest; //导入方法依赖的package包/类
public void notificationBlock(){
    VKParameters params = new VKParameters();
    params.put("time","-1");
    VKRequest request = new VKRequest("account.setSilenceMode",params);
    request.executeWithListener(new VKRequest.VKRequestListener() {

        /*@Override
        public void onError(VKError error) {
            Log.d("Block", error.errorMessage);
        }*/
    });
}
 
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:13,代码来源:VkSdkHelper.java

示例4: notificationReturn

import com.vk.sdk.api.VKRequest; //导入方法依赖的package包/类
public void notificationReturn(){
    VKParameters params = new VKParameters();
    params.put("time","0");
    VKRequest request = new VKRequest("account.setSilenceMode",params);
    request.executeWithListener(new VKRequest.VKRequestListener() {

        /*@Override
        public void onError(VKError error) {
            Log.d("RETURN NOTIFICATION",error.errorMessage);
        }*/
    });
}
 
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:13,代码来源:VkSdkHelper.java

示例5: setStatus

import com.vk.sdk.api.VKRequest; //导入方法依赖的package包/类
public void setStatus(String status){
    VKParameters params = new VKParameters();
    params.put("text", status);

    VKRequest request = new VKRequest("status.set",params);
    request.executeWithListener(new VKRequest.VKRequestListener() {


        /*@Override
        public void onError(VKError error) {
            Log.d("Status",error.errorMessage);
        }*/
    });
}
 
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:15,代码来源:VkSdkHelper.java

示例6: executeSyncWithListener

import com.vk.sdk.api.VKRequest; //导入方法依赖的package包/类
public static void executeSyncWithListener(@NonNull VKRequest vkRequest, @NonNull VKRequest.VKRequestListener vkListener) {
    Listener listener = new Listener(vkListener);
    vkRequest.setUseLooperForCallListener(false);
    vkRequest.executeWithListener(listener);
    synchronized (listener.syncObj) {
        while (!listener.isFinish) {
            try {
                listener.syncObj.wait();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
 
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:15,代码来源:VKSyncRequestUtil.java

示例7: trackVisitor

import com.vk.sdk.api.VKRequest; //导入方法依赖的package包/类
private static void trackVisitor(VKRequest.VKRequestListener l) {
    VKRequest r = new VKRequest("stats.trackVisitor");
    r.attempts = 0;
    r.executeWithListener(l);
}
 
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:6,代码来源:VKSdk.java


注:本文中的com.vk.sdk.api.VKRequest.executeWithListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。