i'm trying to save the recorded audio files in a folder that i wanted it to be rather then the default folder. but somehow i failed to do so.
my code:
Intent recordIntent = new Intent(MediaStore.Audio.Media.RECORD_SOUND_ACTION);
Uri mUri = Uri.fromFile(new File(Environment.getExternalStorageDirectory(), "/Record/sound_"+ String.valueOf(System.currentTimeMillis()) + ".amr"));
recordIntent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, mUri);
startActivityForResult(recordIntent, RESULT_OK);
it did calls the voice recorder app. and also when i press the stop button, it return to my app and have a toast appeared saying its saved. but, rather then saving in my Record folder, it save in the default folder.
i realized that there is error msg in the logcat :
01-29 01:34:23.900: E/ActivityThread(10824): Activity com.sec.android.app.voicerecorder.VoiceRecorderMainActivity has leaked ServiceConnection com.sec.android.app.voicerecorder.util.VRUtil$ServiceBinder@405ce7c8 that was originally bound here
i'm not sure what went wrong as the code works when i call the camera app.
i've found a way to solve this problem, even though it takes a round to do it rather then getting to the point straight, but its the best that i've got and it also work.
instead of calling the voice recorder app with extra included, i just call it without any input :
then, add an onActivityResult, with the request code == 1111 (depends on what you put) and retrieve the last modified file that consist of the extension "3ga" from the default folder of recorder "Sounds"
this way, i can get the name of the file and also do the modification (e.g renaming) with it.
hope this helps other people. =)