74.9 Implementing the stopAudio() Method
The stopAudio() method is responsible for enabling the Play button, disabling the Stop button and then stopping and resetting the MediaRecorder instance. The code to achieve this reads as outlined in the following listing and should be added to the MainActivity.java file:
public void stopAudio (View view)
{
binding.stopButton.setEnabled(false);
binding.playButton.setEnabled(true);
if (isRecording)
{
binding.recordButton.setEnabled(false);
mediaRecorder.stop();
mediaRecorder.release...