本文整理汇总了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));
}
}
示例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));
}
}
示例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);
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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;
}
}
示例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();
}
示例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;
}
}
}
示例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();
}
示例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;
}
}
示例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();
}
示例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;
}
}
}
示例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();
}
示例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;
}
}
示例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;
}
}