无法销毁由java.lang.NullPointerException引起的活动

时间:2016-09-21 08:19:53

标签: android

我有一个带碎片的应用程序。我已经安装了Fabric( Crashlytics ),我收到了同样的问题,我无法在模拟器中重现。崩溃的android是2.3.4 / 2.3.5 / 2.3.6 / 4.0.4 / 4.1.1 / 4.1.2其余版本正常运行。

在我的主要活动中(在destroy函数中)我有一个super.ondestroy();

错误是:

Fatal Exception: java.lang.RuntimeException: Unable to destroy activity {XXXX.BaseActivity_new}: java.lang.NullPointerException
       at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3316)
       at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3334)
       at android.app.ActivityThread.access$1200(ActivityThread.java:137)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1263)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:137)
       at android.app.ActivityThread.main(ActivityThread.java:4838)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:511)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:875)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:642)
       at dalvik.system.NativeStart.main(NativeStart.java)
Caused by java.lang.NullPointerException
       at android.webkit.WebViewClassic.requestFocus(WebViewClassic.java:6938)
       at android.webkit.WebView.requestFocus(WebView.java:2074)
       at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2373)
       at android.view.ViewGroup.requestFocus(ViewGroup.java:2329)
       at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2373)
       at android.view.ViewGroup.requestFocus(ViewGroup.java:2332)
       at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2373)
       at android.view.ViewGroup.requestFocus(ViewGroup.java:2329)
       at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2373)
       at android.view.ViewGroup.requestFocus(ViewGroup.java:2329)
       at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2373)
       at android.view.ViewGroup.requestFocus(ViewGroup.java:2329)
       at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2373)
       at android.view.ViewGroup.requestFocus(ViewGroup.java:2329)
       at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2373)
       at android.view.ViewGroup.requestFocus(ViewGroup.java:2332)
       at android.view.View.requestFocus(View.java:6440)
       at android.view.View.requestFocus(View.java:6419)
       at android.view.View.ensureInputFocusOnFirstFocusable(View.java:4373)
       at android.view.ViewGroup.removeViewInternal(ViewGroup.java:3666)
       at android.view.ViewGroup.removeViewInternal(ViewGroup.java:3626)
       at android.view.ViewGroup.removeView(ViewGroup.java:3558)
       at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1165)
       at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)
       at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1234)
       at android.support.v4.app.FragmentManagerImpl.dispatchDestroy(FragmentManager.java:2083)
       at android.support.v4.app.FragmentController.dispatchDestroy(FragmentController.java:244)
       at android.support.v4.app.FragmentActivity.onDestroy(FragmentActivity.java:368)
       at android.support.v7.app.AppCompatActivity.onDestroy(AppCompatActivity.java:203)
       at XXXX.BaseActivity_new.onDestroy(BaseActivity_new.java:878)
       at android.app.Activity.performDestroy(Activity.java:5174)
       at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1109)
       at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3303)
       at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3334)
       at android.app.ActivityThread.access$1200(ActivityThread.java:137)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1263)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:137)
       at android.app.ActivityThread.main(ActivityThread.java:4838)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:511)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:875)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:642)
       at dalvik.system.NativeStart.main(NativeStart.java)

帮帮我?如何解决这个问题。

0 个答案:

没有答案