Open ankur99999 opened 9 years ago
Facing same problem. I am getting the following exception:
05-25 15:00:06.475: E/AndroidRuntime(2870): FATAL EXCEPTION: main 05-25 15:00:06.475: E/AndroidRuntime(2870): Process: wei.mark.example, PID: 2870 05-25 15:00:06.475: E/AndroidRuntime(2870): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.view.ViewRootImpl.setView(ViewRootImpl.java:536) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:259) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.app.Dialog.show(Dialog.java:286) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.app.AlertDialog$Builder.show(AlertDialog.java:951) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.widget.VideoView$5.onError(VideoView.java:515) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.widget.VideoView.openVideo(VideoView.java:354) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.widget.VideoView.access$2100(VideoView.java:71) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.widget.VideoView$7.surfaceCreated(VideoView.java:607) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.view.SurfaceView.updateWindow(SurfaceView.java:572) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.view.SurfaceView.access$000(SurfaceView.java:86) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:175) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:847) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1867) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:996) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5600) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.view.Choreographer.doCallbacks(Choreographer.java:574) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.view.Choreographer.doFrame(Choreographer.java:544) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.os.Handler.handleCallback(Handler.java:733) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.os.Handler.dispatchMessage(Handler.java:95) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.os.Looper.loop(Looper.java:136) 05-25 15:00:06.475: E/AndroidRuntime(2870): at android.app.ActivityThread.main(ActivityThread.java:5001) 05-25 15:00:06.475: E/AndroidRuntime(2870): at java.lang.reflect.Method.invokeNative(Native Method) 05-25 15:00:06.475: E/AndroidRuntime(2870): at java.lang.reflect.Method.invoke(Method.java:515) 05-25 15:00:06.475: E/AndroidRuntime(2870): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) 05-25 15:00:06.475: E/AndroidRuntime(2870): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 05-25 15:00:06.475: E/AndroidRuntime(2870): at dalvik.system.NativeStart.main(Native Method)
I modified your StandOutExampleActivity to show VideoView in frame, I also modify my XML but VideoView is not showing in frame.
Here is the modified files.
StandOutExampleActivity
simple.xml