當前位置: 首頁>>代碼示例>>Java>>正文


Java BaseResp.getType方法代碼示例

本文整理匯總了Java中com.tencent.mm.sdk.modelbase.BaseResp.getType方法的典型用法代碼示例。如果您正苦於以下問題:Java BaseResp.getType方法的具體用法?Java BaseResp.getType怎麽用?Java BaseResp.getType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.tencent.mm.sdk.modelbase.BaseResp的用法示例。


在下文中一共展示了BaseResp.getType方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onResp

import com.tencent.mm.sdk.modelbase.BaseResp; //導入方法依賴的package包/類
public void onResp(BaseResp baseResp) {
    PingppLog.a("onResp");
    if (baseResp.getType() == 5) {
        PingppLog.d("PaymentActivity wx result errCode : " + baseResp.errCode + " , errStr:"
                + baseResp.errStr);
        this.a.a = 0;
        PingppLog.a("onResp wxPayStatus=" + this.a.a);
        PingppObject.getInstance().wxErrCode = baseResp.errCode;
        if (this.b != null) {
            this.b.finish();
            this.b = null;
            return;
        }
        this.a.a();
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:17,代碼來源:q.java

示例2: onResp

import com.tencent.mm.sdk.modelbase.BaseResp; //導入方法依賴的package包/類
@Override
public void onResp(BaseResp baseResp) {
    if(baseResp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
        if(WXPay.getInstance() != null) {
            if(baseResp.errStr != null) {
                Log.e("wxpay", "errstr=" + baseResp.errStr);
            }

            WXPay.getInstance().onResp(baseResp.errCode);
            finish();
        }
    }
}
 
開發者ID:tsy12321,項目名稱:PayAndroid,代碼行數:14,代碼來源:WXPayCallbackActivity.java

示例3: onResp

import com.tencent.mm.sdk.modelbase.BaseResp; //導入方法依賴的package包/類
public void onResp(BaseResp resp) {
    LogInfo.log("weixin", "onPayFinish, errCode = " + resp.errCode);
    finish();
    if (resp.getType() == 5) {
        if (resp.errCode == 0) {
            LetvAlipayManager.getInstance().startPaySucceedActivity("");
        } else if (resp.errCode != -2) {
            PayFailedActivity.launch(this);
        }
    }
    LetvAlipayManager.getInstance().finishWxPay();
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:13,代碼來源:WXPayEntryActivity.java

示例4: onResp

import com.tencent.mm.sdk.modelbase.BaseResp; //導入方法依賴的package包/類
@Override
public void onResp(BaseResp resp) {
    //Log.d(TAG, "onPayFinish, errCode = " + resp.errCode);

    if (resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle(R.string.app_tip);
        builder.setMessage(getString(R.string.pay_result_callback_msg, String.valueOf(resp.errCode)));
        builder.show();
    }
}
 
開發者ID:linsir6,項目名稱:TripBuyer,代碼行數:12,代碼來源:WXPayEntryActivity.java

示例5: onResp

import com.tencent.mm.sdk.modelbase.BaseResp; //導入方法依賴的package包/類
@Override
public void onResp(BaseResp baseResp) {
    Log.e(TAG, "WeChat pay status code = " + baseResp.errCode);
    if (baseResp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
        if (baseResp.errCode == 0) {//成功
            MWeChatListenerUtil.instance().notifyPaySuccess(baseResp.errStr);
            onPaySuccess(baseResp.errStr);

        } else if (baseResp.errCode == -1) {//錯誤。可能的原因:簽名錯誤、未注冊APPID、項目設置APPID不正確、注冊的APPID與設置的不匹配、其他異常等。
            MWeChatListenerUtil.instance().notifyPayFailure(baseResp.errStr);
            onPayFailure(baseResp.errStr);

        } else if (baseResp.errCode == -2) {//用戶取消	無需處理。發生場景:用戶不支付了,點擊取消,返回APP。
            MWeChatListenerUtil.instance().notifyPayCancel(baseResp.errStr);
            onPayCancel(baseResp.errStr);

        } else {
            MWeChatListenerUtil.instance().notifyPayFailure(baseResp.errStr);
            onPayFailure(baseResp.errStr);
        }
    }

    finish();
}
 
開發者ID:MrxMo,項目名稱:MPay,代碼行數:25,代碼來源:MWeChatPayResultActivity.java

示例6: onResp

import com.tencent.mm.sdk.modelbase.BaseResp; //導入方法依賴的package包/類
@Override
public void onResp(BaseResp resp) {

	if (resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
		AlertDialog.Builder builder = new AlertDialog.Builder(this);
		builder.setTitle("提示");
		builder.setMessage("支付結果"+resp.errStr +";code=" + String.valueOf(resp.errCode));
		builder.show();
	}
}
 
開發者ID:dreamofei,項目名稱:basePay,代碼行數:11,代碼來源:WXPayEntryActivity.java

示例7: onResp

import com.tencent.mm.sdk.modelbase.BaseResp; //導入方法依賴的package包/類
@Override
public void onResp(BaseResp resp) {
	Log.d(TAG, "onPayFinish, errCode = " + resp.errCode);
	Toast.makeText(WXPayEntryActivity.this, resp.errCode + "", Toast.LENGTH_SHORT).show();
	if (resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
		AlertDialog.Builder builder = new AlertDialog.Builder(this);
		builder.setTitle("提示");
		builder.setMessage("微信支付結果" +String.valueOf(resp.errCode));
		builder.show();
	}
}
 
開發者ID:gyqGitHub,項目名稱:WeiXinPayDemo,代碼行數:12,代碼來源:WXPayEntryActivity.java

示例8: onResp

import com.tencent.mm.sdk.modelbase.BaseResp; //導入方法依賴的package包/類
public void onResp(BaseResp resp) {
    if (resp.getType() == 5 && resp.errCode < 0) {
        Helper.showToast((int) R.string.z1);
        finish();
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:7,代碼來源:WXPayEntryActivity.java

示例9: onResp

import com.tencent.mm.sdk.modelbase.BaseResp; //導入方法依賴的package包/類
/**
 * 微信授權後回調
 *
 * @param baseResp
 */
@Override
public void onResp(BaseResp baseResp) {
    int result = 0;
    //type=1  登錄回調   type=2 分享回調
    int type = baseResp.getType();
    switch (baseResp.errCode) {
        //用戶授權成功
        case BaseResp.ErrCode.ERR_OK:
            if (type == WXLOGIN) {
                result = R.string.errcode_success;
                if (baseResp instanceof SendAuth.Resp) {
                    SendAuth.Resp aures = (SendAuth.Resp) baseResp;
                    //獲取code
                    String code = aures.code;
                    //請求獲取UserInfo
                    getAccessToken(code);
                    Intent in = new Intent(WXEntryActivity.this, WebActivity.class);
                    in.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
                    startActivity(in);
                    overridePendingTransition(0, 0);
                    finish();
                }
            }

            if (type == WXSHARE) {
                CommonUtils.showToast(this, "分享成功");
            }

            break;

        //用戶取消授權
        case BaseResp.ErrCode.ERR_USER_CANCEL:
            result = R.string.errcode_cancel;
            if (type == WXLOGIN) {
                finish();
            }
            if (type == WXSHARE) {
                CommonUtils.showToast(this, "分享已取消");
            }
            break;

        //用戶拒絕授權
        case BaseResp.ErrCode.ERR_AUTH_DENIED:
            result = R.string.errcode_deny;
            break;

        default:
            result = R.string.errcode_unknown;
            break;
    }
}
 
開發者ID:JunGeges,項目名稱:AliZhiBoHao,代碼行數:57,代碼來源:WXEntryActivity.java

示例10: onResp

import com.tencent.mm.sdk.modelbase.BaseResp; //導入方法依賴的package包/類
@Override
public void onResp(BaseResp resp) {
    Toast.makeText(this, "openid = " + resp.openId, Toast.LENGTH_SHORT).show();

    if (resp.getType() == ConstantsAPI.COMMAND_SENDAUTH) {
        Toast.makeText(this, "code = " + ((SendAuth.Resp) resp).code, Toast.LENGTH_SHORT).show();
    }

    int result = 0;

    switch (resp.errCode) {
        case BaseResp.ErrCode.ERR_OK:
            result = R.string.errcode_success;
            break;
        case BaseResp.ErrCode.ERR_USER_CANCEL:
            result = R.string.errcode_cancel;
            break;
        case BaseResp.ErrCode.ERR_AUTH_DENIED:
            result = R.string.errcode_deny;
            break;
        default:
            result = R.string.errcode_unknown;
            break;
    }

    Toast.makeText(this, result, Toast.LENGTH_LONG).show();
}
 
開發者ID:linsir6,項目名稱:TripBuyer,代碼行數:28,代碼來源:WXEntryActivity.java

示例11: onResp

import com.tencent.mm.sdk.modelbase.BaseResp; //導入方法依賴的package包/類
@Override
public void onResp(BaseResp baseResp) {
    if (baseResp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
        WXPay.getInstance(this,getWXAppId()).onResp(baseResp.errCode);
        finish();
    }
}
 
開發者ID:kingofglory,項目名稱:EasyPay,代碼行數:8,代碼來源:WXPayEntryBaseActivity.java

示例12: onResp

import com.tencent.mm.sdk.modelbase.BaseResp; //導入方法依賴的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();
}
 
開發者ID:tengbinlive,項目名稱:ooooim_android,代碼行數:39,代碼來源:WXEntryActivity.java

示例13: onResp

import com.tencent.mm.sdk.modelbase.BaseResp; //導入方法依賴的package包/類
@Override
public void onResp(BaseResp resp) {
    Log.d(TAG, "onPayFinish, errCode = " + resp.errCode);  //0:支付成功 1:支付失敗 2:取消支付

    if (resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle(R.string.app_tip);
        builder.setMessage(getString(R.string.pay_result_callback_msg, String.valueOf(resp.errCode)));
        builder.show();
    }
}
 
開發者ID:EthanCo,項目名稱:WeChatPayModule,代碼行數:12,代碼來源:WXPayEntryActivity.java

示例14: onResp

import com.tencent.mm.sdk.modelbase.BaseResp; //導入方法依賴的package包/類
@Override
public void onResp(final BaseResp resp) {


    mAuthListener = WechatAuthManager
            .getPlatformActionListener();
    mShareListener = WechatShareManager.getPlatformActionListener();
    switch (resp.errCode) {
        case BaseResp.ErrCode.ERR_OK:
            if (resp.getType() == TYPE_LOGIN) {
                final String code = ((SendAuth.Resp) resp).code;
                WechatApiService api = getApiService();
                api.getAccessToken(ShareSDK.getInstance().getWechatAppId(), ShareSDK.getInstance().getWechatSecret(), code, "authorization_code", new AccessTokenCallback(mAuthListener, api));
            } else {
                mShareListener.onSuccess();
            }
            break;
        case BaseResp.ErrCode.ERR_USER_CANCEL:
            if (resp.getType() == TYPE_LOGIN) {
                if (mAuthListener != null) {
                    mAuthListener.onCancel();
                }
            } else {
                mShareListener.onCancel();
            }

            break;
        case BaseResp.ErrCode.ERR_SENT_FAILED:
            if (resp.getType() == TYPE_LOGIN) {
                if (mAuthListener != null) {
                    mAuthListener.onError();
                }
            } else {
                mShareListener.onFaild();
            }
            break;
        case BaseResp.ErrCode.ERR_AUTH_DENIED:
            if (resp.getType() == TYPE_LOGIN) {
                if (mAuthListener != null) {
                    mAuthListener.onError();
                }
                Toast.makeText(mContext, R.string.auth_denied, Toast.LENGTH_SHORT).show();
            }
            break;
        case BaseResp.ErrCode.ERR_UNSUPPORT:
            break;
    }
    finish();
}
 
開發者ID:henjue,項目名稱:sharesdk,代碼行數:50,代碼來源:WechatHandlerActivity.java

示例15: onResp

import com.tencent.mm.sdk.modelbase.BaseResp; //導入方法依賴的package包/類
@Override
    public void onResp(BaseResp resp) {

        if(resp.getType() == ConstantsAPI.COMMAND_SENDMESSAGE_TO_WX){

//			String result = "";
//
//			switch (resp.errCode) {
//			case BaseResp.ErrCode.ERR_OK:
//				result = "分享成功";
//				break;
//			case BaseResp.ErrCode.ERR_SENT_FAILED:
//				result = "分享失敗";
//				break;
//			case BaseResp.ErrCode.ERR_USER_CANCEL:
//				result = "分享已取消";
//				break;
//			case BaseResp.ErrCode.ERR_AUTH_DENIED:
//				result = "認證失敗";
//				break;
//			default:
//				result = "未知異常";
//				break;
//			}
            finish();
//			Toast.makeText(this, result, Toast.LENGTH_LONG).show();
        }
    }
 
開發者ID:x251089003,項目名稱:EveryXDay,代碼行數:29,代碼來源:WXEntryActivity.java


注:本文中的com.tencent.mm.sdk.modelbase.BaseResp.getType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。