I have made an rss reader for the android and i want whenever the mobile browser opens an rss and shows the list of the availiable rss readers that i have to show my application among them.
How to associate my application with file type
Page 1 of 12 Replies - 429 Views - Last Post: 25 November 2012 - 04:01 PM
Replies To: How to associate my application with file type
#2
Re: How to associate my application with file type
Posted 25 November 2012 - 02:41 PM
You are going to have to use an intent filter with your activity in AndroidManifest.xml like so:
in your activity to get the url that will be passed use this code:
Also note that some sites may use "text/xml" as the mimeType. In that case just add another intent filter like so:
<activity android:name=".RssActivity">
<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="application/rss+xml" />
</intent-filter>
</activity>
in your activity to get the url that will be passed use this code:
if(this.getIntent().getDataString()!=null)
{
String path = this.getIntent().getDataString();
}
Also note that some sites may use "text/xml" as the mimeType. In that case just add another intent filter like so:
<activity android:name=".RssActivity">
<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="application/rss+xml" />
</intent-filter>
<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="text/xml" />
</intent-filter>
</activity>
#3
Re: How to associate my application with file type
Posted 25 November 2012 - 04:01 PM
thank you very much
Page 1 of 1
|
|

New Topic/Question
Reply


MultiQuote




|