安卓 java。lang.RuntimeException:停止失败。使用MediaRecord时#停止
这是我的full code,这是my project,当我使用MediaRecorder#stop in#onCreate时,它会引发
java.lang.RuntimeException: stop failed.
at 安卓.media.MediaRecorder.stop(Native Method)
at ro.rotry.TestMr.onCreate(TestMr.java:39)
at 安卓.app.Activity.performCreate(Activity.java:6237)
at 安卓.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at 安卓.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at 安卓.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at 安卓.app.ActivityThread.-wrap11(ActivityThread.java)
at 安卓.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at 安卓.os.Handler.dispatchMessage(Handler.java:102)
at 安卓.os.Looper.loop(Looper.java:148)
at 安卓.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.安卓.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.安卓.internal.os.ZygoteInit.main(ZygoteInit.java:616)
那么如何修复呢
# 1 楼答案
原因是我错过了#开始之前的createVirtualDisplay,以下是我的全部活动
# 2 楼答案
而不是这个:
尝试使用摄像机配置文件: