Android intent like Gmail is intent

When I get my activity selection for my ACTION_GET_CONTENT Intent, there are applications that I don’t want to be there, such as those who first create the content and then pass me the URI, for example, Voice Recorder.

When you use Gmail and try to attach the file, you will see only applications / actions that select data from your SDCard, for example Gallery, and in my case Astro (file manager application).

So my question is: what is the intention of using Gmail to attach them?

Here is my code, something should be missing, as I get applications like Voice Recorder, etc.

Intent action = new Intent(Intent.ACTION_GET_CONTENT); action = action.setType("*/*").addCategory(Intent.CATEGORY_OPENABLE); startActivityForResult(Intent.createChooser(action, "Upload file from..."), 1); 

Thanks!

respectfully
Tobias

+4
source share
2 answers
 putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + filePath)); 

EDIT: A possible duplicate of this , this, and a few more

0
source

Here's how to do it:

 Intent intent = new Intent(); intent.setType("*/*"); intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(Intent.createChooser(intent,"Select file"), 1); 
0
source

All Articles