像标题一样,我使用广播和服务创建了一个应用来显示视频视图。我添加面料并将其上传到Google Play。不幸的是,许多用户只使用android 6和7(6.0和7.0.1)和仅三星设备,例如Galaxy J7,SM-G610F ......引发异常:
Fatal Exception: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
at android.view.ViewRootImpl.setView(ViewRootImpl.java:894)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:337)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:109)
at android.app.Dialog.show(Dialog.java:505)
at android.app.AlertDialog$Builder.show(AlertDialog.java:1151)
at android.widget.VideoView$5.onError(VideoView.java:560)
at android.media.MediaPlayer$EventHandler.handleMessage(MediaPlayer.java:3845)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7325)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
以前有人知道过,请帮助我。谢谢。