Dhruvi
Dhruvi

Reputation: 1981

No apps can perform this action

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

Answers (3)

AskNilesh
AskNilesh

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

Mohammed Farhan
Mohammed Farhan

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

IntelliJ Amiya
IntelliJ Amiya

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

Related Questions