Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android filter url in "intent-filter"

I'm developing a application for download image. I have successful to trigger my app when the user click the download image link.How do i filter the specific URL?

here my manifest code :

<activity android:theme="@style/Transparent" android:name=".DownloadImage"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:mimeType="image/*" android:host="*"
                android:scheme="http" />
        </intent-filter>
</activity>

my application will launch and download the image when user click any link in browser but not trigger on specific url, for example "http://www.ABC.com" or the specific item "http://www.ABC.com/image/background.jpg"

like image 413
WynixToo Avatar asked Aug 02 '11 04:08

WynixToo


1 Answers

when your application called for download image you should explore link:

    Intent intent = getIntent();
    String link = intent.getDataString();
like image 68
NrNazifi Avatar answered Sep 20 '22 10:09

NrNazifi