0

In my Android Application, I want to select MP3 files. I have written the following code as mentioned on various thread.

 Intent intentSelectAudio = new Intent();
 intentSelectAudio.setType("audio/mpeg3|audio/x-mpeg-3");
 intentSelectAudio.setAction(Intent.ACTION_GET_CONTENT);
 startActivityForResult(Intent.createChooser(intentSelectAudio, "Select Audio File"), RQS_OPEN_AUDIO_MP3);

There are two problems with this. 1) On some device the menu opens but user is unable to select any MP3 file as everything is disabled. 2) On almost all the devices the menu has several options to select the file. But the some options like "Recent", "Drive", "Audio" are available but user is unable to select files. Also it is showing external file explorer apps as well which is not working either.

Cant I disable the options which are not allowing user to select the files ? What is the way to only show application which allows user to select the desired MP3 file ? Why it is not working on some device ?

Pankaj Goyal
  • 103
  • 1
  • 11
  • Android version which you are testing ? – USKMobility Oct 14 '16 at 04:59
  • All the android versions there are extra options are coming and user is getting confused. Is there any custom library implementation which allows me to choose MP3 only ? – Pankaj Goyal Nov 02 '16 at 09:50
  • I have started using the ACTION_PICK instead of ACTION_GET_CONTENT and it is working better for me. But the problem is that on some of the device the application to support the audio file is not letting me select audio file. As mentioned in the thread http://stackoverflow.com/questions/35509333/intent-action-pick-behaves-differently that there might not be an application on device which let u select the file. So what is the ultimate solution for me if I want user to pick some audio file. – Pankaj Goyal Nov 03 '16 at 06:55

0 Answers0