Search code examples
androidintentfilter

"Private" intent filter for self app use only


I have created a file explorer and register

<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.OPENABLE" />

But I don't want my internal file explorer is begin shown for user to choose when another app send implicit intent with "Openable" category. How can I do so? Should I just create my own action name?

I don't have the explicit one because I want user to choose other file explorer within my app.


Solution

  • I agree with Chris Stratton and Tal Kanel.But instead you can use specific "Data" in your intent filter.Documentation says:

    An Intent object that contains neither a URI nor a data type passes the test only if the filter likewise does not specify any URIs or data types.

    So if an intent has "Openable" category and has not data part that matches your intent filter specific data part,your internal file explorer will be not shown for user.