Dies ist das Snippet des Manifests. Ich möchte die Zeichenfolge an den Abfrageparameter "id" in pathPrefix von der Aktivität übergeben. Wie mache ich das?
<activity
android:name=".MainActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
<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:scheme="http" android:host="www.myHost.com" android:pathPrefix="/video?id="/>
</intent-filter>
</activity>
Antworten:
0 für die Antwort № 1Nun, ich habe das Problem gelöst mit
android:pathPattern="/.*"
im Daten-Tag, anstelle von pathPrefix, und Abfrage wie folgt abrufen:
Uri uri = intent.getData();
String videoId = uri.getQueryParameter("id");