Android 微信支付集成总结

2018-07-09  本文已影响197人  yyg
一、参考文档
二、问题总结

<activity
   android:name=".wxapi.WXPayEntryActivity"
   android:exported="true"
   android:launchMode="singleInstance"
   android:screenOrientation="portrait"
   android:theme="@style/TranslucentTheme"/>

方式二

  @Override
public void onResp(BaseResp resp) {
       Log.d("+++++++++++++++++++","微信支付回调");
       if (resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
           EventBusCustom eventBusCustom = new EventBusCustom(EventBusCustom.WXPAY_RESULT,resp.errCode,null);
           EventBus.getDefault().postSticky(eventBusCustom);
//       AlertDialog.Builder builder = new AlertDialog.Builder(this);
//       builder.setTitle("返回结果");
//       builder.setMessage("微信支付结果:%s"+ resp.errStr +";code=" + String.valueOf(resp.errCode));
//       builder.show();
       }
       finish();
       overridePendingTransition(0,0);
   }
--------
<activity
   android:name=".wxapi.WXPayEntryActivity"
   android:exported="true"
   android:theme=" android:theme="@android:style/Theme.Translucent.NoTitleBar""
   android:launchMode="singleTop" />
-------
上一篇 下一篇

猜你喜欢

热点阅读