You need to decide your path yourself when scheme is content , that is, when you get the URI before the ContentProvider . The system will look for the mime type for your call by ContentResolver.getType(Uri uri) before your intent filter is set, so you need the code below.
Allow the file path by retrieving the cursor from the URI containing the content scheme and query for the _data column:
Cursor cursor = getContentResolver().query(URI, null, null, null, null); if (cursor != null && cursor.moveToFirst()) { int idx = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATA); return cursor.getString(idx); }
And add this intent filter:
<intent-filter > <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:scheme="content" /> <data android:mimeType="ourapp/ourfileextension" /> <data android:mimeType="application/zip" /> <data android:mimeType="application/octet-stream" /> </intent-filter>
Magnus
source share