设备:HM注意1W
Android版本:4.4.2
YouTube播放器库版本:1.2.1
步骤:
在DialogFragment(android.support.v4.app)中使用YouTubePlayerSupportFragment播放视频
终止后台进程 - 某些手机为此功能提供了一个快捷方式,例如MIUI长按菜单键
onError
DeadObjectException抛出
如何解决?如何预防?
堆栈跟踪:
java.lang.IllegalStateException: android.os.DeadObjectException
at aof.g(SourceFile:435)
at als.g(SourceFile:124)
at akr.d(SourceFile:306)
at akr.onTouchEvent(SourceFile:459)
at android.view.View.dispatchTouchEvent(View.java:7790)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2316)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2013)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2322)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1985)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2322)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1985)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2322)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1985)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2322)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1985)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2322)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1985)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2322)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1985)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2145)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1577)
at android.app.Dialog.dispatchTouchEvent(Dialog.java:757)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2093)
at android.view.View.dispatchPointerEvent(View.java:7981)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4432)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4303)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3844)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3894)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3863)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3970)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3871)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4027)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3844)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3894)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3863)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3871)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3844)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6164)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6144)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6098)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6294)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:138)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:5347)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:835)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:651)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by: android.os.DeadObjectException
at android.os.BinderProxy.transact(Binder.java)
at ate.g(SourceFile:308)
at aof.g(SourceFile:432)
at als.g(SourceFile:124)
at akr.d(SourceFile:306)
at akr.onTouchEvent(SourceFile:459)
at android.view.View.dispatchTouchEvent(View.java:7790)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2316)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2013)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2322)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1985)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2322)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1985)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2322)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1985)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2322)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1985)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2322)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1985)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2322)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1985)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2145)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1577)
at android.app.Dialog.dispatchTouchEvent(Dialog.java:757)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2093)
at android.view.View.dispatchPointerEvent(View.java:7981)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4432)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4303)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3844)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3894)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3863)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3970)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3871)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4027)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3844)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3894)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3863)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3871)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3844)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6164)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6144)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6098)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6294)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:138)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:5347)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:835)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:651)
at dalvik.system.NativeStart.main(NativeStart.java)
另一个堆栈跟踪:
java.lang.IllegalStateException: android.os.DeadObjectException
at aof.h(SourceFile:447)
at als.h(SourceFile:130)
at akr.g(SourceFile:402)
at akr.onAnimationEnd(SourceFile:386)
at android.view.animation.Animation$3.run(Animation.java:374)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5347)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:835)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:651)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by: android.os.DeadObjectException
at android.os.BinderProxy.transact(Binder.java)
at ate.h(SourceFile:322)
at aof.h(SourceFile:444)
at als.h(SourceFile:130)
at akr.g(SourceFile:402)
at akr.onAnimationEnd(SourceFile:386)
at android.view.animation.Animation$3.run(Animation.java:374)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5347)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:835)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:651)
at dalvik.system.NativeStart.main(NativeStart.java)