1. I sometimes encounter the situation that mWXSDKInstance.getContext () is null on android. Have you ever encountered it? Occasional phenomenon
2. When you use the fetch, network request that comes with weex, toast pops up when it fails. Oddly enough, as soon as you enter the page, the network fails. If this happens, it will still be the case when you enter again. After app restarts, it can return to normal.
exception information:
context:java.lang.RuntimeException: com.taobao.weex.ui.module.WXModalUIModule@4031b9eInvoker toast
at com.taobao.weex.bridge.NativeInvokeHelper$1.run(NativeInvokeHelper.java:50)
at com.taobao.weex.common.WXThread$SafeRunnable.run(WXThread.java:49)
at android.os.Handler.handleCallback(Handler.java:754)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6221)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.taobao.weex.bridge.MethodInvoker.invoke(MethodInvoker.java:46)
at com.taobao.weex.bridge.NativeInvokeHelper$1.run(NativeInvokeHelper.java:48)
at com.taobao.weex.common.WXThread$SafeRunnable.run(WXThread.java:49)
at android.os.Handler.handleCallback(Handler.java:754)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6221)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method "java.lang.String android.content.Context.getPackageName()" on a null object reference
at android.widget.Toast.<init>(Toast.java:103)
at android.widget.Toast.makeText(Toast.java:256)
at com.taobao.weex.ui.module.WXModalUIModule.toast(WXModalUIModule.java:88)
at java.lang.reflect.Method.invoke(Native Method)
at com.taobao.weex.bridge.MethodInvoker.invoke(MethodInvoker.java:46)
at com.taobao.weex.bridge.NativeInvokeHelper$1.run(NativeInvokeHelper.java:48)
at com.taobao.weex.common.WXThread$SafeRunnable.run(WXThread.java:49)
at android.os.Handler.handleCallback(Handler.java:754)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6221)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)