Alex Rivera | Logout

Android Respond To URL in Intent

Asked 2009-02-08T02:55:56.867
155

I want my intent to be launched when the user goes to a certain url: for example, the android market does this with http://market.android.com/ urls. so does youtube. I want mine to do that too.

Edit
Report

1 Answer

194

I did it! Using <intent-filter>. Put the following into your manifest file:

<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:host="www.youtube.com" android:scheme="http" />
</intent-filter>

This works perfectly!

answered 2009-02-08T03:16:46.060

Your Answer