我的android应用在运行Android 8.0的某些设备上崩溃,但出现以下异常。
当应用尝试显示进度对话框时发生崩溃。
仅此特定设备有此问题。在其他设备上,进度对话框也可以正常工作。
java.lang.RuntimeException:
at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4179)
at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:4219)
at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3314)
at android.app.ActivityThread.-wrap12 (Unknown Source)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1891)
at android.os.Handler.dispatchMessage (Handler.java:108)
at android.os.Looper.loop (Looper.java:166)
at android.app.ActivityThread.main (ActivityThread.java:7425)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:245)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:921)
Caused by: java.lang.RuntimeException:
at android.view.ViewRootImpl.setView (ViewRootImpl.java:857)
at android.view.WindowManagerGlobal.addView (WindowManagerGlobal.java:372)
at android.view.WindowManagerImpl.addView (WindowManagerImpl.java:128)
at android.app.Dialog.show (Dialog.java:454)
at android.app.ProgressDialog.show (ProgressDialog.java:185)
at android.app.ProgressDialog.show (ProgressDialog.java:142)
at com.my.app.MainActivity.downloadInitialData (MainActivity.java:1132)
at com.my.app.MainActivity.onPostResume (MainActivity.java:285)
at android.app.Activity.performResume (Activity.java:7505)
at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4147)
Caused by: android.os.DeadObjectException:
at android.os.BinderProxy.transactNative (Native Method)
at android.os.BinderProxy.transact (Binder.java:751)
at android.view.IWindowSession$Stub$Proxy.addToDisplay (IWindowSession.java:791)
at android.view.ViewRootImpl.setView (ViewRootImpl.java:845)
下面是显示导致崩溃的进度对话框的行。
ProgressDialog.show(MainActivity.this, getString(R.string.loading), getString(R.string.please_wait), true);
有人知道这次崩溃的原因吗?