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


Java VKParameters.put方法代码示例

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


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

示例1: setPhoto

import com.vk.sdk.api.VKParameters; //导入方法依赖的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

示例2: notificationBlock

import com.vk.sdk.api.VKParameters; //导入方法依赖的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

示例3: notificationReturn

import com.vk.sdk.api.VKParameters; //导入方法依赖的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

示例4: setStatus

import com.vk.sdk.api.VKParameters; //导入方法依赖的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

示例5: parseRequestParameters

import com.vk.sdk.api.VKParameters; //导入方法依赖的package包/类
private String parseRequestParameters( FREArray params, VKParameters vkParameters ) {
	if( params != null ) {
		try {
			long length = params.getLength();
			String key = null;
			for( long i = 0; i < length; i++ ) {
				FREObject param = params.getObjectAt( i );
				/* Get key */
				if( i % 2 == 0 ) {
					key = FREObjectUtils.getString( param );
				}
				/* Get value */
				else {
					Object value = null;
					FREObjectType type = getFREObjectType( param );
					switch( type ) {
						case INT:
							value = FREObjectUtils.getInt( param );
							AIR.log( "FREObjectType: INT = " + FREObjectUtils.getInt( param ) );
							break;
						case DOUBLE:
							value = FREObjectUtils.getDouble( param );
							AIR.log( "FREObjectType: DOUBLE = " + FREObjectUtils.getDouble( param ) );
							break;
						case STRING:
							value = FREObjectUtils.getString( param );
							AIR.log( "FREObjectType: STRING = " + FREObjectUtils.getString( param ) );
							break;
						case ARRAY:
							value = FREObjectUtils.getListOfString( (FREArray) param );
							AIR.log( "FREObjectType: ARRAY = " + FREObjectUtils.getListOfString( (FREArray) param ) );
							break;
						case UNKNOWN:
							throw new Exception( "Parameter value for key " + key + " cannot be evaluated." );
					}
					if( value != null ) {
						vkParameters.put( key, value );
					}
				}
			}
		} catch( Exception e ) {
			e.printStackTrace();
			return e.getLocalizedMessage();
		}
	}
	/* No error message */
	return null;
}
 
开发者ID:marpies,项目名称:vk-ane,代码行数:49,代码来源:RequestFunction.java


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