Filtre d'intention à l'aide de chemin,pathPrefix, ou pathPattern
Mon test de la chaîne uri est
http://test.host.com/path/test.html?key1=val1&cle2=val2
Et j'ai l'intention de filtre dans le manifeste
A. régime & hôte (Il fonctionne mais je ne veux pas)
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data
android:scheme="http"
android:host="test.host.com"
/>
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
B. A & chemin(pathPrefix, pathPattern) (Non travaillé)
<data
android:scheme="http"
android:host="test.host.com"
1. android:path="path/test.html" -> not worked (link to chrome broswer)
2. android:path="path" -> not worked (link to chrome broswer)
3. android:pathPrefix="path" -> not worked (link to chrome broswer)
4. android:pathPattern="user/invite.*" -> same (I do not know pattern)
/>
Je veux commencer mon application quand seulement (path/test.html),
OriginalL'auteur ChangUZ | 2013-10-16
Vous devez vous connecter pour publier un commentaire.
Il vous manque la barre oblique au début. La suivante devrait fonctionner:
OU
android:pathPrefix="/path/test.html"==> Ça marche aussi.
OriginalL'auteur David Wasser
Si vous devez démarrer votre application seulement Si lien
/path/test.html
Ensuite Utiliserandroid:path
attribut dansdata
tagComme
android:path
attribut spécifie un chemin d'accès complet est mis en correspondance avec le chemin d'accès complet à l'Intention de l'objet.Mais
android:pathPrefix
attribut spécifie partielle d'un chemin qui est en correspondance avec seulement la partie initiale de la trajectoire dans l'Intention de l'objet.Donc, lors de l'utilisation
android:pathPrefix
attribut pasandroid:path
attribut Qui signifie que votre application peut commencer pour/path/test.html
,/path/test.html?key1=value1
,/path/test.html?key1=value1&key2=value2
,etcPlus d'Informations sur android doc pour la balise de données en
intent-filter
OriginalL'auteur ahmed hamdy
La
pathPrefix
attribut spécifie partielle d'un chemin qui est en correspondance avec seulement le partie initiale de la trajectoire dans l'Intention de l'objet.android:pathPrefix="/path/"
.OriginalL'auteur AndyW