Saturday, 28 September 2013

Get Audio File Uri From File Chooser

Get Audio File Uri From File Chooser

I need help creating a file chooser that gets the path of the audio file
selected as a Uri.
This is what I'm currently using as my file chooser:
public void selectedAudio() {
Intent intent = new Intent();
intent.setType("audio/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
startActivityForResult(Intent.createChooser(intent, "Choose Sound File"), 1);
}
But I have no idea how to get the path of the file selected.

No comments:

Post a Comment