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


Java WBConstants类代码示例

本文整理汇总了Java中com.sina.weibo.sdk.constant.WBConstants的典型用法代码示例。如果您正苦于以下问题:Java WBConstants类的具体用法?Java WBConstants怎么用?Java WBConstants使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


WBConstants类属于com.sina.weibo.sdk.constant包,在下文中一共展示了WBConstants类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleResult

import com.sina.weibo.sdk.constant.WBConstants; //导入依赖的package包/类
@Override
public void handleResult(Intent intent) {
    SendMessageToWeiboResponse baseResponse =
            new SendMessageToWeiboResponse(intent.getExtras());

    switch (baseResponse.errCode) {
        case WBConstants.ErrorCode.ERR_OK:
            ShareUtil.mShareListener.shareSuccess();
            break;
        case WBConstants.ErrorCode.ERR_FAIL:
            ShareUtil.mShareListener.shareFailure(new Exception(baseResponse.errMsg));
            break;
        case WBConstants.ErrorCode.ERR_CANCEL:
            ShareUtil.mShareListener.shareCancel();
            break;
        default:
            ShareUtil.mShareListener.shareFailure(new Exception(baseResponse.errMsg));
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:WeiboShareInstance.java

示例2: onResponse

import com.sina.weibo.sdk.constant.WBConstants; //导入依赖的package包/类
@Override
public final void onResponse(BaseResponse baseResponse) {
    switch (baseResponse.errCode) {
        case WBConstants.ErrorCode.ERR_OK:
            shareSuccess();
            break;
        case WBConstants.ErrorCode.ERR_FAIL:
            shareFailure(new Exception(baseResponse.errMsg));
            break;
        case WBConstants.ErrorCode.ERR_CANCEL:
            shareCancel();
            break;
        default:
            shareFailure(new Exception(baseResponse.errMsg));
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:ShareListener.java

示例3: onResponse

import com.sina.weibo.sdk.constant.WBConstants; //导入依赖的package包/类
@Override
public void onResponse(BaseResponse response) {
    if (response == null) {
        switch (response.errCode) {
        case WBConstants.ErrorCode.ERR_OK:
            mCallback.onSucceed(mActivity, "");
            break;
        case WBConstants.ErrorCode.ERR_CANCEL:
            mCallback.onFailed(mActivity, ResultCode.RESULT_CANCELLED, response.errMsg);
            break;
        case WBConstants.ErrorCode.ERR_FAIL:
            mCallback.onFailed(mActivity, ResultCode.RESULT_FAILED, response.errMsg);
            break;
        }
        mCallback.onCompleted(mActivity);
    }
}
 
开发者ID:czy1121,项目名称:sdk3rd,代码行数:18,代码来源:WBShare.java

示例4: onResponse

import com.sina.weibo.sdk.constant.WBConstants; //导入依赖的package包/类
/**
 * 接收微客户端博请求的数据。
 * 当微博客户端唤起当前应用并进行分享时,该方法被调用。
 * 
 * @param baseRequest 微博请求数据对象
 * @see {@link IWeiboShareAPI#handleWeiboRequest}
 */
@Override
public void onResponse(BaseResponse baseResp) {
    if(baseResp!= null){
        switch (baseResp.errCode) {
        case WBConstants.ErrorCode.ERR_OK:
            Toast.makeText(this, R.string.weibosdk_demo_toast_share_success, Toast.LENGTH_LONG).show();
            break;
        case WBConstants.ErrorCode.ERR_CANCEL:
            Toast.makeText(this, R.string.weibosdk_demo_toast_share_canceled, Toast.LENGTH_LONG).show();
            break;
        case WBConstants.ErrorCode.ERR_FAIL:
            Toast.makeText(this, 
                    getString(R.string.weibosdk_demo_toast_share_failed) + "Error Message: " + baseResp.errMsg, 
                    Toast.LENGTH_LONG).show();
            break;
        }
    }
}
 
开发者ID:ligongzai,项目名称:QianXun,代码行数:26,代码来源:WBShareActivity.java

示例5: onResponse

import com.sina.weibo.sdk.constant.WBConstants; //导入依赖的package包/类
@Override
public void onResponse(BaseResponse baseResponse) {
    if (baseResponse != null) {
        switch (baseResponse.errCode) {
            case WBConstants.ErrorCode.ERR_OK:
                MyNetUtils.shareCount(context, contentId);
                App.getDefault().setValue("sina_auth", true);
                shareListener.onComplete(ShareConstant.SHARE, ShareConstant.SHARE_MEDIA.SINA, baseResponse);
                break;

            case WBConstants.ErrorCode.ERR_CANCEL:
                shareListener.onCancel(ShareConstant.SHARE, ShareConstant.SHARE_MEDIA.SINA);
                break;

            case WBConstants.ErrorCode.ERR_FAIL:
                ShareException nullException = new ShareException(baseResponse.errMsg + baseResponse.reqPackageName + baseResponse.errCode);
                shareListener.onException(ShareType, ShareConstant.SHARE_MEDIA.SINA, nullException);
                break;

            default:
                ShareException exception = new ShareException("default");
                shareListener.onException(ShareType, ShareConstant.SHARE_MEDIA.SINA, exception);
                break;
        }
    }
}
 
开发者ID:junchenChow,项目名称:exciting-app,代码行数:27,代码来源:ShareSina.java

示例6: onResponse

import com.sina.weibo.sdk.constant.WBConstants; //导入依赖的package包/类
@Override
public void onResponse(Object resp) {
    if (resp == null || !(resp instanceof BaseResponse))
        return;
    BaseResponse baseResp = (BaseResponse) resp;
    switch (baseResp.errCode) {
        case WBConstants.ErrorCode.ERR_OK:
            // 分享成功
            mOnShareListener.onSuccess();
            break;
        case WBConstants.ErrorCode.ERR_CANCEL:
            // 分享取消
            mOnShareListener.onCancel();
            break;
        case WBConstants.ErrorCode.ERR_FAIL:
            // 分享失败
            mOnShareListener.onFailure(new SocialException("微博分享失败"));
            break;
    }
}
 
开发者ID:chendongMarch,项目名称:SocialSdkLibrary,代码行数:21,代码来源:WbPlatform.java

示例7: onResponse

import com.sina.weibo.sdk.constant.WBConstants; //导入依赖的package包/类
@Override
public void onResponse(BaseResponse baseResponse) {
    switch (baseResponse.errCode) {
        case WBConstants.ErrorCode.ERR_OK:
            Toast.makeText(this, "分享成功", Toast.LENGTH_LONG).show();
            break;
        case WBConstants.ErrorCode.ERR_CANCEL:
            Toast.makeText(this, "分享取消", Toast.LENGTH_LONG).show();
            break;
        case WBConstants.ErrorCode.ERR_FAIL:
            Toast.makeText(this,
                    "fail" + "错误 Message: " + baseResponse.errMsg,
                    Toast.LENGTH_LONG).show();
            break;
    }
    finish();
}
 
开发者ID:jhwing,项目名称:SKShare,代码行数:18,代码来源:WeiboShareActivity.java

示例8: onResponse

import com.sina.weibo.sdk.constant.WBConstants; //导入依赖的package包/类
public void onResponse(BaseResponse baseResponse) {
    if(baseResponse!= null){
        switch (baseResponse.errCode) {
            case WBConstants.ErrorCode.ERR_OK:
                if(this.mShareListener != null) {
                    this.mShareListener.onComplete(this.mConfig.getName());
                }
                break;
            case WBConstants.ErrorCode.ERR_CANCEL:
                if(this.mShareListener != null) {
                    this.mShareListener.onCancel(this.mConfig.getName());
                }
                break;
            case WBConstants.ErrorCode.ERR_FAIL:
                if(this.mShareListener != null) {
                    this.mShareListener.onError(this.mConfig.getName(), baseResponse.errMsg);
                }
                break;
        }
    }
}
 
开发者ID:tsy12321,项目名称:SocialSDKAndroid,代码行数:22,代码来源:SinaWBHandler.java

示例9: onResponse

import com.sina.weibo.sdk.constant.WBConstants; //导入依赖的package包/类
@Override
public void onResponse(BaseResponse baseResponse) {
    switch (baseResponse.errCode) {
        case WBConstants.ErrorCode.ERR_OK:
            ToastUtil.show(this,R.string.share_success);
            mShareSuccess = true;
            break;
        case WBConstants.ErrorCode.ERR_CANCEL:
            ToastUtil.show(this,R.string.share_cancel);
            break;
        case WBConstants.ErrorCode.ERR_FAIL:
            ToastUtil.show(this,"分享失败" + " Error Message: " + baseResponse.errMsg);
            break;
    }
    finish();
}
 
开发者ID:rRemix,项目名称:APlayer,代码行数:17,代码来源:ShareDialog.java

示例10: onResponse

import com.sina.weibo.sdk.constant.WBConstants; //导入依赖的package包/类
@Override
public void onResponse(BaseResponse baseResponse) {
	if (baseResponse == null) {
		ShareCallbackReceiver.sendBroadcastError(this, ErrorCode.ERROR_SHARE);
		return;
	}
	// 分享成功后返回的是 ErrorCode.ERR_CANCEL???必须是倒计时结束后才能回调分享成功,提前关闭则分享取消!!!
	switch (baseResponse.errCode) {
		case WBConstants.ErrorCode.ERR_OK:
			ShareCallbackReceiver.sendBroadcastComplete(this);
			break;
		case WBConstants.ErrorCode.ERR_CANCEL:
			ShareCallbackReceiver.sendBroadcastCancel(this);
			break;
		case WBConstants.ErrorCode.ERR_FAIL:
			ShareCallbackReceiver.sendBroadcastError(this, ErrorCode.ERROR_SHARE);
			break;
		default:
			finish();
			break;
	}
}
 
开发者ID:Joy-Whale,项目名称:EasyShare,代码行数:23,代码来源:SinaWeiboEntryActivity.java

示例11: onResponse

import com.sina.weibo.sdk.constant.WBConstants; //导入依赖的package包/类
@Override
public void onResponse(BaseResponse response) {
	switch (response.errCode) {
	case WBConstants.ErrorCode.ERR_OK:
		ToastUtils.show(R.string.share_success);
		break;

	case WBConstants.ErrorCode.ERR_FAIL:
		ToastUtils.show(R.string.share_failure);
		break;
		
	case WBConstants.ErrorCode.ERR_CANCEL:
		break;
	}
	finish();
}
 
开发者ID:fengyanjava,项目名称:msb-android,代码行数:17,代码来源:WBEntryActivity.java

示例12: onResponse

import com.sina.weibo.sdk.constant.WBConstants; //导入依赖的package包/类
/**
 * 接收微客户端博请求的数据。
 * 当微博客户端唤起当前应用并进行分享时,该方法被调用。
 * 
 * @see {@link IWeiboShareAPI#handleWeiboRequest}
 */
@Override
public void onResponse(BaseResponse baseResp) {
    if(baseResp!= null){
        switch (baseResp.errCode) {
        case WBConstants.ErrorCode.ERR_OK:
            Toast.makeText(this, R.string.weibosdk_demo_toast_share_success, Toast.LENGTH_LONG).show();
            break;
        case WBConstants.ErrorCode.ERR_CANCEL:
            Toast.makeText(this, R.string.weibosdk_demo_toast_share_canceled, Toast.LENGTH_LONG).show();
            break;
        case WBConstants.ErrorCode.ERR_FAIL:
            Toast.makeText(this, 
                    getString(R.string.weibosdk_demo_toast_share_failed) + "Error Message: " + baseResp.errMsg, 
                    Toast.LENGTH_LONG).show();
            break;
        }
    }
}
 
开发者ID:cowthan,项目名称:AyoSunny,代码行数:25,代码来源:WBShareActivity.java

示例13: onResponse

import com.sina.weibo.sdk.constant.WBConstants; //导入依赖的package包/类
@Override
public void onResponse(BaseResponse baseResponse) {
    //接收微博分享后的返回数据
    switch (baseResponse.errCode){
        case WBConstants.ErrorCode.ERR_OK:
            Toast.makeText(this, "分享成功", Toast.LENGTH_SHORT).show();
            break;
        case WBConstants.ErrorCode.ERR_CANCEL:
            Toast.makeText(this, "取消分享", Toast.LENGTH_SHORT).show();
            break;
        case WBConstants.ErrorCode.ERR_FAIL:
            Toast.makeText(this, "分享失败", Toast.LENGTH_SHORT).show();
            break;
        default:break;
    }
    finish();
}
 
开发者ID:zjupure,项目名称:SneezeReader,代码行数:18,代码来源:ShareActivity.java

示例14: onResponse

import com.sina.weibo.sdk.constant.WBConstants; //导入依赖的package包/类
/**
 * 新浪微博分享回调
 */
@Override
public void onResponse(BaseResponse baseResp) {
	switch (baseResp.errCode) {
       case WBConstants.ErrorCode.ERR_OK:
           Toast.makeText(context, R.string.weibosdk_demo_toast_share_success, Toast.LENGTH_LONG).show();
           break;
       case WBConstants.ErrorCode.ERR_CANCEL:
           Toast.makeText(context, R.string.weibosdk_demo_toast_share_canceled, Toast.LENGTH_LONG).show();
           break;
       case WBConstants.ErrorCode.ERR_FAIL:
           Toast.makeText(context, 
           		context.getString(R.string.weibosdk_demo_toast_share_failed) + "Error Message: " + baseResp.errMsg, 
                   Toast.LENGTH_LONG).show();
           break;
       }
}
 
开发者ID:liuling07,项目名称:QiQuYing,代码行数:20,代码来源:SharePopWindow.java

示例15: onResponse

import com.sina.weibo.sdk.constant.WBConstants; //导入依赖的package包/类
@Override
public void onResponse(BaseResponse response) {
    
    switch (response.errCode) {
    case WBConstants.ErrorCode.ERR_OK:
        Toast.makeText(this, "支付成功", Toast.LENGTH_LONG).show();
        break;
    case WBConstants.ErrorCode.ERR_CANCEL:
        Toast.makeText(this, "支付取消", Toast.LENGTH_LONG).show();
        break;
    case WBConstants.ErrorCode.ERR_FAIL:
        Toast.makeText(this,"支付失败     " + "Error Message: " + response.errMsg, Toast.LENGTH_LONG).show();
        break;
    }
}
 
开发者ID:ligongzai,项目名称:QianXun,代码行数:16,代码来源:WBPayActivity.java


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