如何获取Android DeepLink数据
设置用于深链接的应用程序后。通过在浏览器中打开链接时创建一个活动以启动。如何获得浏览器用来启动意图的链接?
让我们说该应用程序捕获URL:“ https://example.com/foo/bar?param=1&data=extra”。 在启动的活动中,我想使用打开应用程序的URL。我想也许像int的活动一样,
Intent intent = getIntent();
String action = intent.getAction();
Uri data = intent.getData();
我不知道从uri数据访问lauch url的变量
After setting up an app for deep linking. by creating an activity to launch when the link is opened in the browser. How do I go about getting the link that the browser used to start the intent?
Let us say the app catches the URL: "https://example.com/foo/bar?param=1&data=extra".
In the Activity launched I want to use the URL which opened the app. I am thinking maybe something like int the activity perform
Intent intent = getIntent();
String action = intent.getAction();
Uri data = intent.getData();
I dont know the variable to access the lauch URL from Uri data
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,我在正确的轨道上,我要做的就是
获取“ https://example.com/foo/bar?param = 1&data = extra” ie“ ie” param = 1& data = 1 extrace''的最后一部分
否则,请调用诸如function()的数据的另一个函数以获取URI的其他方面,例如整个URL,这会导致活动stackoverflow打开的整个URL,
这会让您认为在发布问题后我总是立即找到答案的时间一半。
It turns out I was on the right track all I do is
To get the last part of "https://example.com/foo/bar?param=1&data=extra" ie "param=1&data=extra"
Otherwise, call another function of data like.function() to get other aspects of the URI eg the whole URL that led to the opening of the activity
Stackoverflow makes you think half the time I always find the answer Immediately after I post a question.