I want my application to open when the user attempts to visit a site by TYPING a certain URL into the browser. My intent filter looks like this:
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<data android:host="www.youtube.com" android:scheme="http"></data>
</intent-filter>
</activity>
</application>
When I try to go to YouTube the site loads as it normally would, without opening my app. Is it even possible to open an application this way, or is this limited to links that are clicked/tapped?
Aucun commentaire:
Enregistrer un commentaire