Reputation: 1981
When I am trying to invoke implicit intent with action "Intent.ACTION_GET_CONTENT"
, I am getting this error alert "No apps can perform this action."
Thanks in advance. Please see my code below.
Intent intent = new Intent();
intent.setType("*/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select File"), SELECT_FILE);
Upvotes: 2
Views: 13804
Reputation: 69681
try this
Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
intent.setType("video/*, images/*");
startActivityForResult(Intent.createChooser(intent, "Select File"), SELECT_FILE);
Upvotes: 1
Reputation: 1138
You need to set an explicit MIME data type to intent. For example
Intent intent=new Intent(Intent.ACTION_PICK);
intent.setType("image/*"); //for image pick from gallery via intent
intent.setType("video/*"); //for video pick from gallery via intent
Upvotes: 1
Reputation: 75778
Problem coming from setType section .
This is used to create intents that only specify a type and not data, for example to indicate the type of data to return.
Don't
intent.setType("*/*"); // Arise problem
Do
intent.setType("image/*");
EDITED
You can try with
Intent intent_open = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
intent_open.setType("image/* video/*");
Upvotes: 3