Search code examples
androidurlandroid-intentintentfilterlaunch

Android Respond To URL in Intent


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.


Solution

  • 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!