本文整理汇总了Java中com.tencent.mm.sdk.modelmsg.SendMessageToWX.Resp方法的典型用法代码示例。如果您正苦于以下问题:Java SendMessageToWX.Resp方法的具体用法?Java SendMessageToWX.Resp怎么用?Java SendMessageToWX.Resp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.tencent.mm.sdk.modelmsg.SendMessageToWX
的用法示例。
在下文中一共展示了SendMessageToWX.Resp方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shareComplete
import com.tencent.mm.sdk.modelmsg.SendMessageToWX; //导入方法依赖的package包/类
public static void shareComplete(SendMessageToWX.Resp resp) {
if (null != mCallback) {
switch (resp.errCode) {
case BaseResp.ErrCode.ERR_OK:
mCallback.onSuccess();
break;
case BaseResp.ErrCode.ERR_USER_CANCEL:
mCallback.onCancel();
break;
case BaseResp.ErrCode.ERR_AUTH_DENIED:
default:
mCallback.onFailure(new Exception("BaseResp.ErrCode.ERR_AUTH_DENIED"));
break;
}
}
}
示例2: onResp
import com.tencent.mm.sdk.modelmsg.SendMessageToWX; //导入方法依赖的package包/类
@Override
public void onResp(BaseResp resp) {
if (resp instanceof SendAuth.Resp)
WeChatSSOProxy.authComplete((SendAuth.Resp) resp);
else if (resp instanceof SendMessageToWX.Resp)
WeChatShareProxy.shareComplete((SendMessageToWX.Resp) resp);
finish();
}
示例3: onResp
import com.tencent.mm.sdk.modelmsg.SendMessageToWX; //导入方法依赖的package包/类
@Override public void onResp(BaseResp baseResp) {
Log.d("onResp", "onResp " + baseResp);
if(baseResp instanceof SendAuth.Resp) {
WeChatManager.handleSso((SendAuth.Resp)baseResp);
}else if(baseResp instanceof SendMessageToWX.Resp) {
}
finish();
}
示例4: onResp
import com.tencent.mm.sdk.modelmsg.SendMessageToWX; //导入方法依赖的package包/类
@Override
public void onResp(BaseResp resp) {
if (resp == null) {
finish();
return;
}
String result = "";
if (resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
if (resp.errCode == 0) {
toPaySuccessActivity();
} else if (resp.errCode == -1) {
result = "支付失败";
} else if (resp.errCode == -2) {
result = "支付取消";
}
} else
// 如果是分享
if (resp instanceof SendMessageToWX.Resp) {
switch (resp.errCode) {
case BaseResp.ErrCode.ERR_OK:
result = "分享成功";
break;
case BaseResp.ErrCode.ERR_USER_CANCEL:
result = "分享取消";
break;
case BaseResp.ErrCode.ERR_AUTH_DENIED:
result = "认证失败";
break;
default:
result = "未知错误";
break;
}
} else {
result = "类型错误";
}
CommonUtil.showToast(result);
finish();
}
示例5: onResp
import com.tencent.mm.sdk.modelmsg.SendMessageToWX; //导入方法依赖的package包/类
@Override
public void onResp(BaseResp resp) {
if (resp == null) {
finish();
return;
}
String result = "";
if (resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
if (resp.errCode == 0) {
toPaySuccessActivity();
} else if (resp.errCode == -1) {
result = "支付失败";
} else if (resp.errCode == -2) {
result = "支付取消";
}
} else
// 如果是分享
if (resp instanceof SendMessageToWX.Resp) {
switch (resp.errCode) {
case BaseResp.ErrCode.ERR_OK:
result = "分享成功";
break;
case BaseResp.ErrCode.ERR_USER_CANCEL:
result = "分享取消";
break;
case BaseResp.ErrCode.ERR_AUTH_DENIED:
result = "认证失败";
break;
default:
result = "未知错误";
break;
}
}
// 如果是获取授权信息
// else if (resp instanceof Resp) {
// switch (resp.errCode) {
// case BaseResp.ErrCode.ERR_OK:
// Resp authResp = (Resp) resp;
// Intent intent = new Intent(Constant.WeiXin.AUTH_SUCCESS_FROM_WX);
// intent.putExtra(Constant.WeiXin.AUTH_RESPONSE_CODE, authResp.code);
// intent.putExtra(Constant.WeiXin.AUTH_RESPONSE_URL, authResp.url);
// intent.putExtra(Constant.WeiXin.AUTH_RESPONSE_STATE, authResp.state);
// sendBroadcast(intent);
// break;
// case BaseResp.ErrCode.ERR_USER_CANCEL:
// result = "登录取消";
// break;
// case BaseResp.ErrCode.ERR_AUTH_DENIED:
// result = "认证失败";
// break;
// default:
// result = "未知错误";
// break;
// }
// }
else {
result = "类型错误";
}
CommonUtil.showToast(result);
finish();
}