First, resource/folder
is not an official MIME type.
Second, ACTION_VIEW
is for viewing a piece of content. A directory is not a piece of content, from Android's standpoint.
There is no requirement for any Android device to have any activity capable of viewing the contents of a directory. There are no official standards for what Intent
structure would request such an activity. There may be some conventions among file manager developers (e.g., whatever the heck resource/folder
is supposed to be), but there is no requirement for all file managers to offer such an activity or for a user to have installed such a file manager.
So, you resolve the issue by either:
Deleting the code and eliminating the feature, or
Using PackageManager
and queryIntentActivities()
to see whether there is an activity that handles your Intent
, failing gracefully if there is none
Catching the ActivityNotFoundException
and failing gracefully if one is thrown
Do not attempt to rely upon third-party apps for browsing a directory, and implement your own UI for that, perhaps using existing third-party libraries for that