Skip to content Skip to sidebar Skip to footer

Android Mediarecorder Exception When Stopped

I am creating an app that records phone calls, both incoming and outgoing. The recording should stop when call ends.But I get an Illegal State Exception.Th exception is at mediarec

Solution 1:

private void stopRecording() {
if (null != recorder){
    try {
        recorder.prepare(); 

You should not be calling prepare when you're stopping the MediaRecorder. The prepare method is something you call prior to starting the recorder. Refer to the state diagram in the MediaRecorder documentation.


Post a Comment for "Android Mediarecorder Exception When Stopped"