recorder.stop() Forceclose error again
<p>im trying to create an audio recorder for android, there are two buttons and a textview one button starts recording and the other stops it, my problem is that when i press the stop button my app crashes with a forceclose error... starting the recording works fine,,
My Code is :</p>

<pre><code>package com.soundtest3;

import java.io.IOException;

import com.soundtest3.R;

import android.app.Activity;
import android.media.MediaRecorder;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class soundtest3 extends Activity {
    /** Called when the activity is first created. */


    Button btn_start;
    Button btn_stop;
    TextView status_text;
    MediaRecorder recorder;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        btn_start  = (Button)findViewById(R.id.start);
        btn_stop  = (Button)findViewById(R.id.stop);
        status_text = (TextView)findViewById(R.id.status);

        btn_start.setOnClickListener(new OnClickListener()
        {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub

                recorder = new MediaRecorder();
                recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
                recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
                recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
                recorder.setOutputFile("/sdcard/sample.3gp");
                /*
                    recorder.setOnErrorListener(errorListener);
                    recorder.setOnInfoListener(infoListener);
                 */
                try {
                    recorder.prepare();
                    recorder.start();
                } catch (IllegalStateException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                status_text.setText("Recording...");
            }

        });
        btn_stop.setOnClickListener(new OnClickListener(){

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub

                recorder.stop();
                recorder.release();
                recorder = null;

                status_text.setText("Stoped");
            }

        });

    }
}
</code></pre>
