本文整理匯總了Java中com.tencent.mm.sdk.modelbase.BaseReq類的典型用法代碼示例。如果您正苦於以下問題:Java BaseReq類的具體用法?Java BaseReq怎麽用?Java BaseReq使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
BaseReq類屬於com.tencent.mm.sdk.modelbase包,在下文中一共展示了BaseReq類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onReq
import com.tencent.mm.sdk.modelbase.BaseReq; //導入依賴的package包/類
@Override
public void onReq(BaseReq req) {
Toast.makeText(this, "openid = " + req.openId, Toast.LENGTH_SHORT).show();
switch (req.getType()) {
case ConstantsAPI.COMMAND_GETMESSAGE_FROM_WX:
goToGetMsg();
break;
case ConstantsAPI.COMMAND_SHOWMESSAGE_FROM_WX:
goToShowMsg((ShowMessageFromWX.Req) req);
break;
case ConstantsAPI.COMMAND_LAUNCH_BY_WX:
Toast.makeText(this, R.string.launch_from_wx, Toast.LENGTH_SHORT).show();
break;
default:
break;
}
}
示例2: handleResult
import com.tencent.mm.sdk.modelbase.BaseReq; //導入依賴的package包/類
@Override
public void handleResult(Intent data) {
mIWXAPI.handleIntent(data, new IWXAPIEventHandler() {
@Override
public void onReq(BaseReq baseReq) {
}
@Override
public void onResp(BaseResp baseResp) {
switch (baseResp.errCode) {
case BaseResp.ErrCode.ERR_OK:
ShareUtil.mShareListener.shareSuccess();
break;
case BaseResp.ErrCode.ERR_USER_CANCEL:
ShareUtil.mShareListener.shareCancel();
break;
default:
ShareUtil.mShareListener.shareFailure(new Exception(baseResp.errStr));
}
}
});
}
示例3: a
import com.tencent.mm.sdk.modelbase.BaseReq; //導入依賴的package包/類
public void a(JSONObject jSONObject) {
String string = jSONObject.getString("appId");
this.c.registerApp(string);
this.c.handleIntent(this.a.getIntent(), this);
BaseReq payReq = new PayReq();
payReq.appId = string;
payReq.partnerId = jSONObject.getString("partnerId");
payReq.prepayId = jSONObject.getString("prepayId");
payReq.nonceStr = jSONObject.getString("nonceStr");
if (jSONObject.get("timeStamp") instanceof String) {
payReq.timeStamp = jSONObject.getString("timeStamp");
} else {
payReq.timeStamp = jSONObject.getInt("timeStamp") + "";
}
payReq.packageValue = jSONObject.getString("packageValue");
payReq.sign = jSONObject.getString("sign");
this.c.sendReq(payReq);
}
示例4: genRequest
import com.tencent.mm.sdk.modelbase.BaseReq; //導入依賴的package包/類
public static BaseReq genRequest(WXMediaMessage msg, ShareTypeEnum type) {
SendMessageToWX.Req req = new SendMessageToWX.Req();
switch (type) {
case TEXT:
req.transaction = buildTransaction("text");
break;
case MUSIC:
req.transaction = buildTransaction("music");
break;
case VIDEO:
req.transaction = buildTransaction("video");
break;
case IMAGE:
req.transaction = buildTransaction("img");
break;
}
req.message = msg;
req.scene = SendMessageToWX.Req.WXSceneSession;
return req;
}
示例5: onReq
import com.tencent.mm.sdk.modelbase.BaseReq; //導入依賴的package包/類
public void onReq(BaseReq basereq)
{
switch (basereq.getType())
{
default:
return;
case 3: // '\003'
Log.d("chenee", "never come here ??????");
return;
case 4: // '\004'
a((com.tencent.mm.sdk.modelmsg.ShowMessageFromWX.Req)basereq);
break;
}
}
示例6: handleResult
import com.tencent.mm.sdk.modelbase.BaseReq; //導入依賴的package包/類
@Override
public void handleResult(int requestCode, int resultCode, Intent data) {
mIWXAPI.handleIntent(data, new IWXAPIEventHandler() {
@Override
public void onReq(BaseReq baseReq) {
}
@Override
public void onResp(BaseResp baseResp) {
if (baseResp instanceof SendAuth.Resp && baseResp.getType() == 1) {
SendAuth.Resp resp = (SendAuth.Resp) baseResp;
switch (resp.errCode) {
case BaseResp.ErrCode.ERR_OK:
getToken(resp.code);
break;
case BaseResp.ErrCode.ERR_USER_CANCEL:
mLoginListener.loginCancel();
break;
case BaseResp.ErrCode.ERR_SENT_FAILED:
mLoginListener.loginFailure(new Exception(INFO.WX_ERR_SENT_FAILED));
break;
case BaseResp.ErrCode.ERR_UNSUPPORT:
mLoginListener.loginFailure(new Exception(INFO.WX_ERR_UNSUPPORT));
break;
case BaseResp.ErrCode.ERR_AUTH_DENIED:
mLoginListener.loginFailure(new Exception(INFO.WX_ERR_AUTH_DENIED));
break;
default:
mLoginListener.loginFailure(new Exception(INFO.WX_ERR_AUTH_ERROR));
}
}
}
});
}
示例7: sendReq
import com.tencent.mm.sdk.modelbase.BaseReq; //導入依賴的package包/類
public final boolean sendReq(BaseReq baseReq) {
if (this.detached) {
throw new IllegalStateException("sendReq fail, WXMsgImpl has been detached");
} else if (!WXApiImplComm.validateAppSignatureForPackage(this.context, "com.tencent.mm",
this.checkSignature)) {
a.a(TAG, "sendReq failed for wechat app signature check failed");
return false;
} else if (baseReq.checkArgs()) {
a.d(TAG, "sendReq, req type = " + baseReq.getType());
Bundle bundle = new Bundle();
baseReq.toBundle(bundle);
if (baseReq.getType() == 5) {
return sendPayReq(this.context, bundle);
}
if (baseReq.getType() == 7) {
return sendJumpToBizProfileReq(this.context, bundle);
}
if (baseReq.getType() == 8) {
return sendJumpToBizWebviewReq(this.context, bundle);
}
if (baseReq.getType() == 9) {
return sendAddCardToWX(this.context, bundle);
}
com.tencent.mm.sdk.a.a.a aVar = new com.tencent.mm.sdk.a.a.a();
aVar.n = bundle;
aVar.m = "weixin://sendreq?appid=" + this.appId;
aVar.k = "com.tencent.mm";
aVar.l = WXApp.WXAPP_MSG_ENTRY_CLASSNAME;
return com.tencent.mm.sdk.a.a.a(this.context, aVar);
} else {
a.a(TAG, "sendReq checkArgs fail");
return false;
}
}
示例8: sendReq
import com.tencent.mm.sdk.modelbase.BaseReq; //導入依賴的package包/類
public final boolean sendReq(BaseReq basereq)
{
if (e)
{
throw new IllegalStateException("sendReq fail, WXMsgImpl has been detached");
}
if (!com.tencent.mm.sdk.openapi.c.a(b, "com.tencent.mm", d))
{
com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "sendReq failed for wechat app signature check failed");
return false;
}
if (!basereq.checkArgs())
{
com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "sendReq checkArgs fail");
return false;
}
com.tencent.mm.sdk.b.a.c("MicroMsg.SDK.WXApiImplV10", (new StringBuilder("sendReq, req type = ")).append(basereq.getType()).toString());
Bundle bundle = new Bundle();
basereq.toBundle(bundle);
if (basereq.getType() == 5)
{
return a(b, bundle);
}
if (basereq.getType() == 7)
{
return b(b, bundle);
}
if (basereq.getType() == 8)
{
return c(b, bundle);
} else
{
com.tencent.mm.sdk.a.a.a a1 = new com.tencent.mm.sdk.a.a.a();
a1.e = bundle;
a1.d = (new StringBuilder("weixin://sendreq?appid=")).append(c).toString();
a1.b = "com.tencent.mm";
a1.c = "com.tencent.mm.plugin.base.stub.WXEntryActivity";
return com.tencent.mm.sdk.a.a.a(b, a1);
}
}
示例9: onReq
import com.tencent.mm.sdk.modelbase.BaseReq; //導入依賴的package包/類
@Override
public void onReq(BaseReq req) {
}
示例10: onReq
import com.tencent.mm.sdk.modelbase.BaseReq; //導入依賴的package包/類
@Override
public void onReq(BaseReq baseReq) {
}
示例11: onReq
import com.tencent.mm.sdk.modelbase.BaseReq; //導入依賴的package包/類
public void onReq(BaseReq req) {
}
示例12: onReq
import com.tencent.mm.sdk.modelbase.BaseReq; //導入依賴的package包/類
public void onReq(BaseReq arg0) {
}
示例13: onReq
import com.tencent.mm.sdk.modelbase.BaseReq; //導入依賴的package包/類
@Override
public void onReq(BaseReq baseReq) {
switch (baseReq.getType()) {
case ConstantsAPI.COMMAND_GETMESSAGE_FROM_WX:
break;
case ConstantsAPI.COMMAND_SHOWMESSAGE_FROM_WX:
break;
default:
break;
}
}
示例14: onReq
import com.tencent.mm.sdk.modelbase.BaseReq; //導入依賴的package包/類
public void onReq(BaseReq baseReq) {
finish();
}
示例15: onReq
import com.tencent.mm.sdk.modelbase.BaseReq; //導入依賴的package包/類
public void onReq(BaseReq req) {
if (this.mWxHandler != null) {
this.mWxHandler.getWXEventHandler().onReq(req);
}
finish();
}