本文整理汇总了Java中com.vk.sdk.api.VKRequest.addExtraParameters方法的典型用法代码示例。如果您正苦于以下问题:Java VKRequest.addExtraParameters方法的具体用法?Java VKRequest.addExtraParameters怎么用?Java VKRequest.addExtraParameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vk.sdk.api.VKRequest
的用法示例。
在下文中一共展示了VKRequest.addExtraParameters方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: getSaveRequest
import com.vk.sdk.api.VKRequest; //导入方法依赖的package包/类
@Override
protected VKRequest getSaveRequest(JSONObject response) {
VKRequest saveRequest;
try {
saveRequest = VKApi.docs().save(new VKParameters(VKJsonHelper.toMap(response)));
} catch (JSONException e) {
return null;
}
if (mGroupId != 0)
saveRequest.addExtraParameters(VKUtil.paramsFrom(VKApiConst.GROUP_ID, mGroupId));
return saveRequest;
}
示例3: getSaveRequest
import com.vk.sdk.api.VKRequest; //导入方法依赖的package包/类
@Override
protected VKRequest getSaveRequest(JSONObject response) {
VKRequest saveRequest;
try {
saveRequest = VKApi.photos().saveWallPhoto(new VKParameters(VKJsonHelper.toMap(response)));
} catch (JSONException e) {
return null;
}
if (mUserId != 0)
saveRequest.addExtraParameters(VKUtil.paramsFrom(VKApiConst.USER_ID, mUserId));
if (mGroupId != 0)
saveRequest.addExtraParameters(VKUtil.paramsFrom(VKApiConst.GROUP_ID, mGroupId));
return saveRequest;
}
示例4: getSaveRequest
import com.vk.sdk.api.VKRequest; //导入方法依赖的package包/类
@Override
protected VKRequest getSaveRequest(JSONObject response) {
VKRequest saveRequest;
try {
saveRequest = VKApi.photos().save(new VKParameters(VKJsonHelper.toMap(response)));
} catch (JSONException e) {
return null;
}
if (mAlbumId != 0)
saveRequest.addExtraParameters(VKUtil.paramsFrom(VKApiConst.ALBUM_ID, mAlbumId));
if (mGroupId != 0)
saveRequest.addExtraParameters(VKUtil.paramsFrom(VKApiConst.GROUP_ID, mGroupId));
return saveRequest;
}