我在应用程序中工作。需要创建一个深层链接。用户可以共享特定项目,并且可以从单击链接打开直接页面。我在这里输入链接描述
<intent-filter >
<!-- android:autoVerify="true"-->
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"
android:host="www.jobzminer.com"
android:pathPrefix="/appplay" />
<data android:scheme="jobzminer"
android:host="appplay" />
</intent-filter>
但是,当我将链接放入浏览器时,它不起作用。
如评论中所述,将您的网址更新为:https://www.jobzminer.com/appplay
。另外,将浏览器清除为默认应用。
要传递参数,可以使用查询参数。像这样更改您的网址:https://www.jobzminer.com/appplay?param1=hello¶m2=world
然后在您的活动中。做这个:
Intent intent = getIntent();
Uri data = intent.getData();
String param1 = data.getQueryParameter("param1");
String param2 = data.getQueryParameter("param2");
您也可以在这里看到我的答案。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句