[英]How to add a space in action of an intent filter of a activity In Android Manifest File
[英]How can I update path prefix attribute of data tag in intent filter in android manifest from activity?
這是清單的片段。 我想將字符串傳遞給活動中pathPrefix中的查詢參數'id'。 我怎么做?
<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>
好吧,我已經解決了使用
android:pathPattern="/.*"
在數據標簽中,代替pathPrefix,並按以下方式獲取查詢:
Uri uri = intent.getData();
String videoId = uri.getQueryParameter("id");
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.