- 微信授权登录后返回时会null
您好,你们提供的微信登录授权后接口调用,有些手机会有问题,取不到Context=null https://developers.weixin.qq.com/doc/oplatform/Downloads/Android_Resource.html 代码如下: private static class MyHandler extends Handler { private final WeakReference<WXEntryActivity> wxEntryActivityWeakReference; public MyHandler(WXEntryActivity wxEntryActivity){ wxEntryActivityWeakReference = new WeakReference<WXEntryActivity>(wxEntryActivity); } @Override public void handleMessage(Message msg) { int tag = msg.what; switch (tag) { case NetworkUtil.GET_TOKEN: { Bundle data = msg.getData(); JSONObject json = null; try { json = new JSONObject(data.getString("result")); String openId, accessToken, refreshToken, scope; openId = json.getString("openid"); accessToken = json.getString("access_token"); refreshToken = json.getString("refresh_token"); scope = json.getString("scope"); Intent intent = new Intent(wxEntryActivityWeakReference.get(), SendToWXActivity.class); //这里会出错 intent.putExtra("openId", openId); intent.putExtra("accessToken", accessToken); intent.putExtra("refreshToken", refreshToken); intent.putExtra("scope", scope); wxEntryActivityWeakReference.get().startActivity(intent); } catch (JSONException e) { Log.e(TAG, e.getMessage()); } } } } } wxEntryActivityWeakReference.get() 为空 错误日志: Thread Name: 'main' Back traces starts. java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference at android.content.ComponentName.<init>(ComponentName.java:132) at android.content.Intent.<init>(Intent.java:7415) at com.xxx.xxx.wxapi.WXEntryActivity$MyHandler.handleMessage(WXEntryActivity.java:55) at android.os.Handler.dispatchMessage(Handler.java:117) at android.os.Looper.loopOnce(Looper.java:205) at android.os.Looper.loop(Looper.java:293) at android.app.ActivityThread.loopProcess(ActivityThread.java:9928) at android.app.ActivityThread.main(ActivityThread.java:9917) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:586) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1233) Back traces ends.
2023-10-13 - 微信流量主结算单无法打开,同时后台补发结算单失败问题?
您好,我们你们的小程序开发者,在使用你们的流量主财务结算时出现以下问题: 1、之前你们发过来的结算单无法打开,通过多种方式都打不开你们发过来的结算PDF文件(错误:游览器,PDF工具都无法打开文件) 2、你们的后台点补发结算单也是无法使用(错误:提示补发失败) 3、请教一下,我是不是可以把几个月的已结算的一起开成一张发票寄过来? 打印各自的结算单。 4、请教一下,有几个月只有几元钱这种我是不是可以不进行结算,不去管它,比如:我只打印2022-1-1以后的结算单,开票金额也是打印的结算单的总额。 wx7cdd4779c130068b
2022-06-01