I am using standout library, I added a videoView in it, Everything is running correctly, Except if i click on video then mediaController Is not Showing and i am getting null pointer exception. Here is my code:-
final LayoutInflater inflater = (LayoutInflater)
getSystemService(LAYOUT_INFLATER_SERVICE);
final View view = inflater.inflate(R.layout.simple, frame, true);
localVideoView = (VideoView) view.findViewById(R.id.videoView1);
MediaController mediaController = new MediaController(StandOutExampleActivity.getActivity());
mediaController.setAnchorView(localVideoView);
localVideoView.setMediaController(mediaController);
localVideoView.setVideoPath("android.resource://" + getPackageName() + "/"
+ R.raw.ba);
localVideoView.start();
Log File:-
67: E/AndroidRuntime(1997): FATAL EXCEPTION: main
01-14 19:48:56.767: E/AndroidRuntime(1997): java.lang.NullPointerException
01-14 19:48:56.767: E/AndroidRuntime(1997): at android.view.View.onAttachedToWindow(View.java:11709)
01-14 19:48:56.767: E/AndroidRuntime(1997): at android.view.View.dispatchAttachedToWindow(View.java:12125)
01-14 19:48:56.767: E/AndroidRuntime(1997): at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2450)
01-14 19:48:56.767: E/AndroidRuntime(1997): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1207)
01-14 19:48:56.767: E/AndroidRuntime(1997): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1004)
01-14 19:48:56.767: E/AndroidRuntime(1997): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5481)
01-14 19:48:56.767: E/AndroidRuntime(1997): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
01-14 19:48:56.767: E/AndroidRuntime(1997): at android.view.Choreographer.doCallbacks(Choreographer.java:562)
01-14 19:48:56.767: E/AndroidRuntime(1997): at android.view.Choreographer.doFrame(Choreographer.java:532)
01-14 19:48:56.767: E/AndroidRuntime(1997): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
01-14 19:48:56.767: E/AndroidRuntime(1997): at android.os.Handler.handleCallback(Handler.java:730)
01-14 19:48:56.767: E/AndroidRuntime(1997): at android.os.Handler.dispatchMessage(Handler.java:92)
01-14 19:48:56.767: E/AndroidRuntime(1997): at android.os.Looper.loop(Looper.java:137)
01-14 19:48:56.767: E/AndroidRuntime(1997): at android.app.ActivityThread.main(ActivityThread.java:5103)
01-14 19:48:56.767: E/AndroidRuntime(1997): at java.lang.reflect.Method.invokeNative(Native Method)
01-14 19:48:56.767: E/AndroidRuntime(1997): at java.lang.reflect.Method.invoke(Method.java:525)
01-14 19:48:56.767: E/AndroidRuntime(1997): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
01-14 19:48:56.767: E/AndroidRuntime(1997): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
01-14 19:48:56.767: E/AndroidRuntime(1997): at dalvik.system.NativeStart.main(Native Method)