开发者

video thumbnails not working

Hai friends I am trying to display thumbnail videos in my media player and it's not working. Log cat error is

10-25 19:50:35.577: ERROR/MediaPlayerService(33):   error: -2
10-25 19:50:35.577: ERROR/MediaPlayer(65): Unable to to create media player
10-25 19:50:35.916: ERROR/AndroidRuntime(1175): FATAL EXCEPTION: main
10-25 19:50:35.916: ERROR/AndroidRuntime(1175): java.lang.RuntimeException: Unable to start activity ComponentInfo{media.media/media.media.VideoViewDemo}: java.lang.NullPointerException
10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at android.os.Handler.dispatchMessage(Handler.java:99)
10-25 19:50:35.916: ERROR/开发者_如何学编程AndroidRuntime(1175):     at android.os.Looper.loop(Looper.java:123)
10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at android.app.ActivityThread.main(ActivityThread.java:4627)
10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at java.lang.reflect.Method.invokeNative(Native Method)
10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at java.lang.reflect.Method.invoke(Method.java:521)
10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at dalvik.system.NativeStart.main(Native Method)
10-25 19:50:35.916: ERROR/AndroidRuntime(1175): Caused by: java.lang.NullPointerException
10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at media.media.VideoViewDemo.onCreate(VideoViewDemo.java:72)
10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
10-25 19:50:35.916: ERROR/AndroidRuntime(1175):     ... 11 more


If you could include the code for that activity (the java file), it would be very helpful.

From what I see now, I can tell you that you are trying to call a method in the process of starting your media player with a null object i.e. you are missing one of the required parameters for a method.

Hopefully that helps, but if it doesn't, please post your code so that I can determine what the exact issue is. Thanks.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜