I need to fetch an audio file from SD Card and play it. I think this can be done by getting URI of an audio file. So, to pick an audio file I\'m using following code:
No need to add type here like audio/*. It will crash to search such type of action. Try this. It worked for me.
val intent = Intent(Intent.ACTION_PICK, android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI) startActivityForResult(intent, AUDIO_REQUEST_CODE)