How to record video using Intents?
<p>I need to unserstand how I can record video programatically. Now I use this construction:</p>

<pre><code>public class AndroidLearningActivity extends Activity {
    /** Called when the activity is first created. */   
    @Override
    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        this.setContentView(R.layout.main);

        Intent captureVideoIntent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
        startActivityForResult(captureVideoIntent, 100);
    }  

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        Uri uri=data.getData();
        Log.e("result", "result:"+resultCode);

    }
}
</code></pre>

<p>When the application is opened then the camera will be opened too. I have record some video, but if I press "back" button on the device then the application crushes. Please, explain me, how can I do it? Thank you. </p>
