Delete contact option selection options

I open a file with Intent using Bellow code

Intent intent_upload = new Intent(); intent_upload.setType("*/*"); intent_upload.setAction(Intent.ACTION_GET_CONTENT); activity.startActivityForResult(intent_upload, Constants.FILE_PICK_REQUEST_CODE); 

I want to remove contact information from the list, please someone can help.

thanks enter image description here

+8
java android android-intent picking
source share
3 answers

Use the code below. I think it can help you, and also link. Link

 Intent intent_upload = new Intent(); intent_upload.setType("*/*"); intent_upload.setAction(Intent.ACTION_GET_CONTENT); intent_upload.addCategory(Intent.CATEGORY_OPENABLE); activity.startActivityForResult(intent_upload, Constants.FILE_PICK_REQUEST_CODE); 
+5
source share

You need to specify what type of intentions (applications) you want to open. Now you offer me all the applications:

 intent_upload.setType("*/*"); 

It may be a different type for images, music, documents, etc., for example:

 intent.setType("image/*"); 
0
source share

As CommonsWare says you have no alternatives other than setting a specific MIME_TYPES and ignoring it with "*/*" . Use the specified MIME_TYPES as here ..

  String[] mimetypes = {"image/*", "video/*"}; Intent intent_upload = new Intent(); intent_upload.setType("image/*,video/*"); intent_upload.putExtra(Intent.EXTRA_MIME_TYPES, mimetypes); intent_upload.setAction(Intent.ACTION_GET_CONTENT); MainActivity.this.startActivityForResult(intent_upload, Constants.FILE_PICK_REQUEST_CODE); 
0
source share

All Articles