Intent-filter for “content” uris like content://media/external/images/media/4711 only

I have written an imageviewer for local files that should also be started from gallery via a content-uri.

My problem:

How to define a manifest intent-filter that only matches uris like content://media/external/images/media/4711 but not http or https uris?

What i already have:

(1) A working filter for local file images (that is used to start the image view from a filemanager)

    <activity ... >
        <intent-filter>
            <data android:mimeType="image/*" android:scheme="file" />

            <action android:name="android.intent.action.VIEW" /> 
            <action android:name="android.intent.action.SEND" /> 
            <action android:name="android.intent.action.SENDTO" />
            <category android:name="android.intent.category.DEFAULT" /> 
            <category android:name="android.intent.category.BROWSABLE" />
        </intent-filter>

(2) and a filter for all images that is to broad (including http, https, file, content) Unfortunatley my app cannont handle http(s) content :-(

    <activity ... >
        <intent-filter>
            <data android:mimeType="image/*" />

            <action android:name="android.intent.action.VIEW" /> 
            <action android:name="android.intent.action.SEND" /> 
            <action android:name="android.intent.action.SENDTO" />
            <category android:name="android.intent.category.DEFAULT" /> 
            <category android:name="android.intent.category.BROWSABLE" />
        </intent-filter>

(3) What I have tried that does not work for uris like content://media/external/images/media/4711 My Test: using the "gallery" app-s share on an android 4.4 handset: my activity is not triggered.

    <activity ... >
        <intent-filter>
            <data android:mimeType="image/*" android:scheme="content" />


            <action android:name="android.intent.action.VIEW" /> 
            <action android:name="android.intent.action.SEND" /> 
            <action android:name="android.intent.action.SENDTO" />
            <category android:name="android.intent.category.DEFAULT" /> 
            <category android:name="android.intent.category.BROWSABLE" />
        </intent-filter>

Up to now i have tried these data elements that did not work:

        <data android:scheme="content" android:host="*"  />

        <data android:scheme="content" android:host="media" 
               android:pathPattern="/external/images/media/.*" />

        <data android:host="*" android:scheme="content" android:mimeType="image/*" />

Is there a way to get "content" only uris or "file" + "content" but not "http", "https", .... ?

Answers


Standard image share intent:

<intent-filter>
    <category android:name="android.intent.category.DEFAULT"/>
    <action android:name="android.intent.action.SEND" />
    <data android:mimeType="image/*"/>
</intent-filter>

Need Your Help

Add missing xts/zoo data with linear interpolation in R

r time-series xts zoo

I do have problems with missing data, but I do not have NAs - otherwise would be easier to handle...