调用stop()
我的 MediaRecorder 会无限期地挂在三星 Galaxy 相机上。将此调用放在单独的线程中也无济于事。
Logcat 不显示任何错误消息。但是,在 Samsung Galaxy Nexus 上运行相同的应用程序不会产生任何问题。
这是我调用的代码stop
:
View.OnClickListener captureListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
if (isRecording) {
// stop recording and release camera
mMediaRecorder.stop();
releaseMediaRecorder(); // release the MediaRecorder object
mCamera.lock(); // take camera access back from MediaRecorder
// inform the user that recording has stopped
captureButton.setText("Capture");
isRecording = false;
} else {
// initialize video camera
if (prepareVideoRecorder()) {
// Camera is available and unlocked, MediaRecorder is prepared,
// now you can start recording
mMediaRecorder.start();
// inform the user that recording has started
captureButton.setText("Stop");
isRecording = true;
} else {
// prepare didn't work, release the camera
releaseMediaRecorder();
// inform user
}
}
}
};