ページ

2015年8月28日金曜日

MediaControllerのバグかもしれない

MediaControllerのバグかもしれない

  1. VideoViewを使って、横位置FullScreenで動画を再生させる。
  2. MediaControllerを使って、pauseを手動で行う。動画は停止状態になる。
  3. 端末を縦位置にする。configuration changeを発生させる。
  4. Logが真っ赤になる。

真っ赤に流れるボクのLogCat
同じことを2回行うと、端末が反応しなくなり、再起動が必要になる。

E/WindowManager﹕ android.view.WindowLeaked: Activity jp.androyer.playmp4.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{2210feb8 V.E..... R....... 0,0-1280,117} that was originally added here
            at android.view.ViewRootImpl.<init>(ViewRootImpl.java:370)
            at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
            at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
            at android.widget.MediaController.show(MediaController.java:349)
            at android.widget.MediaController.show(MediaController.java:306)
            at android.widget.VideoView.toggleMediaControlsVisiblity(VideoView.java:697)
            at android.widget.VideoView.onTouchEvent(VideoView.java:638)
            at android.view.View.dispatchTouchEvent(View.java:7767)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2230)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1931)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2230)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1931)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2230)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1931)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2230)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1931)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2230)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1931)
            at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2072)
            at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1518)
            at android.app.Activity.dispatchTouchEvent(Activity.java:2531)
            at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2020)
            at android.view.View.dispatchPointerEvent(View.java:8004)
            at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4136)
            at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3990)
            at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3548)
            at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3598)
            at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3567)
            at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3674)
            at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3575)
            at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3731)
            at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3548)
            at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3598)
            at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3567)
            at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3575)
            at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3548)
            at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5817)
            at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5797)
            at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5768)
            at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:5897)
            at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
            at android.os.MessageQueue.nativePollOnce(Native Method)
            at android.os.MessageQueue.next(MessageQueue.java:138)
            at android.os.Looper.loop(Looper.java:131)
            at android.app.ActivityThread.main(ActivityThread.java:5257)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:788)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:604)
            at dalvik.system.NativeStart.main(Native Method)

解答は次のサイトにあった。
Android MediaPlayer with MediaController: LogCat error “Activity has leaked window that was originally added here”

onSaveInstanceState()やonCreate(Bundle savedInstanceState)による作り込みを完成させてから、こんな現象が発生することを知った。むむむ!

0 件のコメント:

コメントを投稿