No apps can perform this action

Dhruvi picture Dhruvi · Jul 15, 2017 · Viewed 10.2k times · Source

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);

Answer

IntelliJ Amiya picture IntelliJ Amiya · Jul 15, 2017

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/*");