Invoking audio recorder and getting the resulting file
<p>I am trying to invoke the audio recorder on Android 2.2.1 (device Samsung Galaxy POP) using the following code:</p>

<pre><code>private static final int ACTIVITY_RECORD_SOUND = 1;
Intent intent = new Intent(MediaStore.Audio.Media.RECORD_SOUND_ACTION);
startActivityForResult(intent, ACTIVITY_RECORD_SOUND);
</code></pre>

<p>This invokes the recorder successfully. In my activity result i do the following:</p>

<pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == Activity.RESULT_OK) {
        switch (requestCode) {
                         case ACTIVITY_RECORD_SOUND:
                             data.getDataString();
                         break;
                            }
                }
       }
</code></pre>

<p>After i complete the recording i press back on the audio recorder which returns the control to the onActivityResult method as expected, but my resultCode is always 0 (which is Activity.RESULT_CANCELED) and my data is null. Am i missing out on something here? Kindly help me with this. This works on the emulator but not on the device. Thanks in advance.</p>
