Intent filter with circuit and host not working

I have the following intent filter:

<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:scheme="content" android:host="my.company.name" />
</intent-filter>

But this does not correspond to the following Intent:

Uri uri = new Uri.Builder().scheme("content").authority("my.company.name").appendPath("names").build()
uri = Uri.withAppendedPath(uri, id1);
uri = Uri.withAppendedPath(uri, "data");

startActivity(new Intent(Intent.ACTION_VIEW, uri));

Why is this happening?

+3
source share
1 answer

You may not be able to register activity for the schema contentbecause it is used by the content provider system.

If your activity is really supported by content providers, use the MIME type for this, for example:

<data android:mimeType="vnd.android.cursor.dir/vnd.google.note" />

If this is related to your other recent SO question , you can contact the Google employee who answered this question for advice. Here is an example project demonstrating this method, especially the third <intent-filter>in the manifest.

+3

All Articles