Intent.ACTION_GET_CONTENT con tipo = "audio/*" no funciona: muestra todos los archivos

I've a button on which I would like to open any file manager, and allow user to pick ONLY audio files. So i wrote something like this:

Intent intent = new Intent();
intent.setType("audio/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select audio", SELECTED_AUDIO);

However, this doesn't work - it opens file manager (in my case Astro) and voalaaa - I can see and also pick any files I want - I mean, text files, video files, etc. Simple it doesn't filter or check anything...What am I doing wrong? Or its fault of Astro? I just want to show only audio files, or show all files but allow to pick only audio.

preguntado el 25 de agosto de 12 a las 17:08

1 Respuestas

¿Qué estoy haciendo mal?

Nada.

Or its fault of Astro?

Sort of. You assume that Astro knows the MIME type of all its files, and that it will actually use the MIME type to filter the results. There is nothing forcing Astro to do either of those things. The same holds true for any file manager or anything else that responds to ACTION_GET_CONTENT por audio/*. Now, it would be agradable if Astro would do the filtering or something, but that's an issue you would have to take up with them.

Respondido 25 ago 12, 17:08

thx, I thought it. I implemented my own file chooser in 30 minutes, so I don't care about this issue no more... - qkx

however - can you PLEASE take a look on my previous question? stackoverflow.com/questions/12109074/…. Nevertheless you're one of most competent people on this forum so I don't wanna throw a chance if you're here now ;) Thx a lot - qkx

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.