I have an activity that I want to run every time the user goes to the xml page (especially rss) in the browser (at least assuming the user gets it from the list of applications that can support it).
I already have the current intent filter:
<activity android:name=".activities.EpisodesListActivity" android:theme="@android:style/Theme.NoTitleBar"> <intent-filter> <category android:name="android.intent.category.BROWSABLE"></category> <category android:name="android.intent.category.DEFAULT"></category> <action android:name="android.intent.action.VIEW"></action> <data android:scheme="http"></data> </intent-filter> </activity>
Now, as you can guess, this is a malicious intent, as it wants to open whenever a page is requested via http. However, when I declare a line:
<data android:mimeType="application/rss+xml"></data>
to do this:
<activity android:name=".activities.EpisodesListActivity" android:theme="@android:style/Theme.NoTitleBar"> <intent-filter> <category android:name="android.intent.category.BROWSABLE"></category> <category android:name="android.intent.category.DEFAULT"></category> <action android:name="android.intent.action.VIEW"></action> <data android:scheme="http"></data> <data android:mimeType="application/rss+xml"></data> </intent-filter> </activity>
The application no longer claims to be able to run rss files.
Also, if I changed the line to:
<data android:mimeType="application/xml"></data>
It will also not work (for a regular XML file even).
So, what intent filter should be done to claim that activity supports rss.
(In addition, bonus points, if you can tell me how I know which URL it opened to the user. So far, I always sent this information from one activity to another using additional functions).
thanks for the help