Mehvish Ali
Mehvish Ali

Reputation: 752

All apps associated with this action have been disabled, blocked, or are not installed Storage Access Framework

In my application I am trying to get MS-Word and PDF files through Storage Access Framework which works well on some devices I've tested upon but on Samsung note 4 API 6 I am getting an error

All apps associated with this action have been disabled, blocked, or are not installed

Code:

warantyButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
                intent.addCategory(Intent.CATEGORY_OPENABLE);
                intent.setType("application/pdf,application/msword");
                Intent i = Intent.createChooser(intent, "File");
                getActivity().startActivityForResult(i, FILE_REQ_CODE);

            }
        });

Upvotes: 3

Views: 11210

Answers (2)

user5803705
user5803705

Reputation:

I'm not sure if this is directly related to your issue, but it is related to an issue I personally had with this error when using Intents (Incorrectly). I have received this error when attempting to declare an Intent globally. For example:

public class MyClass{

// Class Variables (BAD)
private Intent someActivity = new Intent(this, SomeClass.class);

    @Override
    protected void onCreate(Bundle savedInstanceState){
        // Some Code
    }

}

Then, I found that this issue was resolved when I did this:

public class MyClass{

// Class Variables (Not Bad)
private Intent someActivity;

    @Override
    protected void onCreate(Bundle savedInstanceState){
        someActivity = new Intent(this, SomeClass.class);
    }

} 

If this doesn't help you in your specific situation, I hope this helps someone at some point.

When debugging to find the reason behind this problem, I couldn't see any note of the Toast that generated the text "All apps associated with this action have been disabled, blocked, or are not installed." There was no trace of this being an "error." It seems to me more of an OS-handled exception for incorrect usage of Intents.

Upvotes: 2

Vikash Kumar Tiwari
Vikash Kumar Tiwari

Reputation: 805

Since setType() method of Intent takes one argument as String i.e MIME type and its compulsary because based on the MIME type requested android system finds all actions that are supported.

For example if you want to choose any type of content then you can simply write setType("*/*").

Upvotes: 0

Related Questions