【发布时间】:2015-07-03 11:15:45
【问题描述】:
我尝试通过点击 url 打开我的应用并从中获取价值,url 看起来像:path.com/item?key=value
在清单中:
<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="path.com"
android:pathPrefix="/item"
android:scheme="http" />
</intent-filter>
但是
Uri data = getIntent().getData();
data.getPathSegments();
Log.d("TAG", "param is:" + params.get(0);
返回:参数是:item /item。如何获取 key=value 或完整的 url
【问题讨论】: