gpt4 book ai didi

android - 通过单击 SMS url 打开应用程序特定 Activity 时获取 url

转载 作者:太空狗 更新时间:2023-10-29 12:54:40 25 4
gpt4 key购买 nike

我可以通过单击 SMS url 通过 intent 过滤器打开子 Activity ,但我需要访问该 URL,这样来自其他 Activity 的 ID 可以通过该 url 直接访问该子 Activity .那么,如何做到...如需更多信息,请提出任何疑问。感谢您的关心。

最佳答案

如果是被拦截的网址,例如“www.roflcopter.se/hai/2u”,那么数据可以这样提取:

Intent intent = parent.getIntent();
String action = intent.getAction(); // for example Intent.ACTION_VIEW
String host = intent.getData().getHost(); // "www.roflcopter.se"
List<String> segments = intent.getData().getPathSegments(); // {"hai", "2u"}

相同的语法可用于所有类型的拦截。查看哪些方法返回您感兴趣的数据。:)

关于android - 通过单击 SMS url 打开应用程序特定 Activity 时获取 url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8092802/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com