I’m working on an app that involves having the user record audio. I’m using the following intent to call the Audio Recorder.
Intent intent = new Intent(MediaStore.Audio.Media.RECORD_SOUND_ACTION);
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(path)));
startActivityForResult(intent, AUDIO_REQ);
While this works fine on the emulator and nearly all devices it’s been tested on, when I try to run it on a Samsung Charge the Audio Recorder never gives me the option to save the recording and return to my Activity. Once the recording is complete, I’m sent to a list of all recorded audio on the device, and selecting any from this list just plays them. I can return to the calling Activity with the back button, but this causes a RESULT_CANCLED result code, no file is created at path, and the data parameter of onActivityResult is null. (data is still null if I remove the EXTRA_OUTPUT extra from the intent, nothing changes in this case)
Does anyone know of a way to make the Audio Recorder on this device act correctly? Or can anyone at least confirm that this is solely a Samsung Charge issue, and not something I’ll have to worry about on many devices?
I’m with the same problem on a Samsung Galaxy S SCL. So this issue can happen in many devices. Maybe the best solution is to implement your own recorder instead of using an Intent to the built-in… But not as suggested above (I assume is better to have an unified interface for the app, and not a different one for each device. So if you’ve to write your own recording GUI, why don’t use it to all devices?).
So anyway, if you found the way to go back from the recorder and get the data, it will be nice if you post it here. Thanks