当我从相机应用程序开始录制视频时,只有在meizu设备上才会发生此崩溃:
11-20 12:20:45.221: E/AndroidRuntime(7104): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.meizu.media.camera/com.meizu.media.camera.CameraActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'long android.os.Bundle.getLong(java.lang.String)' on a null object reference
11-20 12:20:45.221: E/AndroidRuntime(7104): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2677)
11-20 12:20:45.221: E/AndroidRuntime(7104): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2747)
11-20 12:20:45.221: E/AndroidRuntime(7104): at android.app.ActivityThread.access$900(ActivityThread.java:187)
11-20 12:20:45.221: E/AndroidRuntime(7104): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1584)
11-20 12:20:45.221: E/AndroidRuntime(7104): at android.os.Handler.dispatchMessage(Handler.java:111)
11-20 12:20:45.221: E/AndroidRuntime(7104): at android.os.Looper.loop(Looper.java:194)
11-20 12:20:45.221: E/AndroidRuntime(7104): at android.app.ActivityThread.main(ActivityThread.java:5877)
11-20 12:20:45.221: E/AndroidRuntime(7104): at java.lang.reflect.Method.invoke(Native Method)
11-20 12:20:45.221: E/AndroidRuntime(7104): at java.lang.reflect.Method.invoke(Method.java:372)
11-20 12:20:45.221: E/AndroidRuntime(7104): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1015)
11-20 12:20:45.221: E/AndroidRuntime(7104): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:810)
11-20 12:20:45.221: E/AndroidRuntime(7104): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'long android.os.Bundle.getLong(java.lang.String)' on a null object reference
11-20 12:20:45.221: E/AndroidRuntime(7104): at com.meizu.media.camera.d.q.av(VideoMode.java:1292)
11-20 12:20:45.221: E/AndroidRuntime(7104): at com.meizu.media.camera.d.q.<init>(VideoMode.java:183)
11-20 12:20:45.221: E/AndroidRuntime(7104): at com.meizu.media.camera.d.q.<init>(VideoMode.java:190)
11-20 12:20:45.221: E/AndroidRuntime(7104): at com.meizu.media.camera.d.e.a(CameraModeFactory.java:36)
11-20 12:20:45.221: E/AndroidRuntime(7104): at com.meizu.media.camera.o.bm(MzCamModule.java:1418)
11-20 12:20:45.221: E/AndroidRuntime(7104): at com.meizu.media.camera.o.a(MzCamModule.java:1514)
11-20 12:20:45.221: E/AndroidRuntime(7104): at com.meizu.media.camera.CameraActivity.onCreate(CameraActivity.java:481)
11-20 12:20:45.221: E/AndroidRuntime(7104): at android.app.Activity.performCreate(Activity.java:6127)
11-20 12:20:45.221: E/AndroidRuntime(7104): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1128)
11-20 12:20:45.221: E/AndroidRuntime(7104): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2630)
它适用于所有其他设备。我这样叫相机:
Intent takeVideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
if (takeVideoIntent.resolveActivity(getPackageManager()) != null) {
startActivityForResult(takeVideoIntent, REQUEST_VIDEO_CAPTURE);
}
有人有任何想法吗?