Chiamare il numero stop()
sul mio MediaRecorder si blocca indefinitamente sulla fotocamera Samsung Galaxy. Anche piazzare questa chiamata in un thread separato non aiuta il problema.MediaRecorder.stop() si blocca su Samsung Galaxy Camera
Logcat non mostra alcun messaggio di errore. Tuttavia, l'esecuzione della stessa app non comporta problemi sul Samsung Galaxy Nexus.
Questo è il codice che circonda la mia chiamata a 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
}
}
}
};