Android Studio 开发:App Links 与 Profiler 全解析
1. Android Studio App Links 教程
1.1 协议声明
最新版本的 Android 要求同时为 HTTP 和 HTTPS 协议声明 App Links,即便只使用其中一种协议,也需将 HTTPS 版本的 URL 添加到列表中。
1.2 添加 Intent 过滤器
Intent 过滤器可使目标活动在点击 App Link 时被启动。添加 URL 映射时,Intent 过滤器会自动添加到项目清单文件中。在 App Links Assistant 的 URL 映射列表中选择 URL 映射,向下滚动屏幕,直到看到 Intent 过滤器预览部分,其中包含修改后的 AndroidManifest.xml 文件及新添加的 Intent 过滤器。
1.3 添加 Intent 处理代码
1.3.1 现有代码分析
当前代码期望在 Intent 包的额外数据中找到地标 ID:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityLandmarkBinding.inflate(getLayoutInflater());
View view = binding.getRoot();
setContentView(v
超级会员免费看
订阅专栏 解锁全文
1884

被折叠的 条评论
为什么被折叠?



