如何通过深层链接传递数据? [英] How to pass data through deep linking?
问题描述
我的应用程序中有一个要约列表,每个列表项上都有一个共享按钮。当任何用户单击共享链接时,我都使用深层链接打开我的应用程序的要约详细信息活动。一种情况,当有人单击链接时触发了我的详细信息页面活动,但是我怎么知道,当有人单击共享的深层链接时,它提供了详细信息活动。
I am having a list of offers in my application and there is a share button on every list item.I am using deep link to open a offer detail activity of my application when any user clicks on the shared link.i am in a situation that my detail page activity is being triggered when someone clicks the link ,But how can i know ,which offer detail activity to show when some one clicks on the shared deep link .
推荐答案
清单文件将与此链接中指定的相同 https://developer.android.com/training/app-indexing/deep-linking.html
The manifest file will remain same as specified in this link https://developer.android.com/training/app-indexing/deep-linking.html
但是您可以在您发送给用户的链接中以 www.example.com/gizmos?key=valueToSend
But you can provide the extra data in the link you send to the user as www.example.com/gizmos?key=valueToSend
的形式提供额外数据,然后在活动中您可以执行以下操作
then in the activity you can do something like
Uri data = intent.getData();
data.getQueryParameter("key");
这篇关于如何通过深层链接传递数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!