- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试向我的应用添加深层链接。我在我的一个 Activity 中添加了 2 个 Intent 过滤器,一个用于“http”方案,另一个用于我的自定义方案(我正在使用“示例”)。我根据这个 SO ( Deep-linking intent does not work ) 中的信息为每个方案添加了一个 Intent 过滤器,这样我就可以同时处理 example://test
和 http://www. example.com/test
类型的链接。
这是我的 XML:
<activity
android:name="com.myapp.myapp.SplashActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:label="Intent Filter label">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.LAUNCHER" />
<!-- Accepts URIs that begin with "http://www.example.com/test2” -->
<data android:scheme="http"
android:host="www.example.com"
android:pathPrefix="/test2" />
</intent-filter>
<intent-filter android:label="Intent Filter label">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.LAUNCHER" />
<!-- Accepts URIs that begin with "example://test2” -->
<data android:scheme="example"
android:host="test2" />
</intent-filter>
</activity>
当我在 ADB 中测试时,它们正在正确加载:
adb shell am start -W -a android.intent.action.MAIN -d "example://test2" com.myapp.myapp
返回
Starting: Intent { act=android.intent.action.MAIN dat=example://test2 pkg=com.myapp.myapp }
Status: ok
Activity: com.myapp.myapp/com.app.myapp.SplashActivity
ThisTime: 357
TotalTime: 357
Complete
但是,我在浏览器中什么也得不到。当我在浏览器中尝试这个时:FF 中的“example://test2
”我得到“找不到打开此链接的应用
”,在 Chrome 和 native 浏览器中,它打开了新的 Google搜索“example://test2
”。
当我尝试另一种样式时:“http://www.example.com/test2
”,它只是尝试在所有 3 种浏览器中导航到该网页。
我正在从 Android Studio 将应用程序部署到我的手机。我还尝试生成调试 APK,将其发送到我的手机并进行安装。两者的结果相同。我做错了什么? 据我所知,我已经按照指南 ( https://developer.android.com/training/app-indexing/deep-linking.html ) 完成了这封信。 我的应用是否需要在商店中才能使用深层链接?
最佳答案
呃,我的 action 是 MAIN,而它应该是 VIEW...
<intent-filter>
<action android:name="android.intent.action.MAIN" />
...
<intent-filter>
<action android:name="android.intent.action.VIEW" />
关于Android 深度链接在 ADB 中有效,但在浏览器中无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33768954/
使用 http://developer.android.com/training/basics/firstapp/running-app.html 上的指南,我使用 adb 将示例 Hello, Wo
如何修复 - 无法创建调试桥:无法启动 adb 服务器:无法检测 adb 版本,adb 输出:/home/dilip/Downloads/sdk/platform-tools/adb: 1:/home
我在 UBUNTU 18.x 操作系统上练习 REACT NATIVE,一切运行顺利,昨天我更新了我的 React native、react 和 android gradle 版本然后我收到一些错误,
这个问题在这里已经有了答案: android studio adb Syntax error: ")" unexpected (4 个答案) 关闭 5 年前。 我确实将我的工作室更新到 Linux
这是我的步骤: adb connect 'my android IP address' connected adb reboot //in this step my phone is rebootin
我有一个应用程序可以监听接收通知。安装后,我应该从设置 -> 安全 -> 通知访问启用通知访问 我在模拟器上安装这个应用程序并使用 ADB 运行它。但我不知道如何使用 ADB 中的命令行为其启用通知访
ADB全称Android Debug Bridge, 是android sdk里的一个工具, 用这个工具可以直接操作管理android模拟器或者真实的andriod设备(如G1手机). 它的主要功能
我知道这个问题被问了多次,也有一些替代答案。所以请不要关闭其他链接,因为我在下面添加了该链接。 [2014-01-23 16:19:44 - adb] ADB server didn't ACK [2
我在 adb 中观察到了这种新行为v1.0.39。命令: adb shell getevent -l 给出以下输出: 观察到最后一行是不完整的。这发生在许多不同的设备上。相同的命令在 adb 中无需缓
我正在尝试通过 adb shell am 和 adb shell service call 发送短信。我都收到错误消息。 a) 我正在尝试按照 adb shell am 命令发送短信 adb shel
由于某些原因,我的手机无法使用电缆。 我在 Internet 上看到可以通过 Wifi 将 adb 连接到 Wifi,但是我试了一下,结果是这样的: adb devices List of devic
尝试通过 expo 在模拟器上运行 react-native 应用程序时出现此错误。 Couldn't start project on Android: Error running adb: adb
这个问题在这里已经有了答案: adb server version doesn't match this client (41 个回答) 关闭4年前。 在启动 genymotion 模拟器后尝试从终
adb server version (39) doesn't match this client (40); killing... could not read ok from ADB Server
我已经创建了一个虚拟 Android 模拟器 (Nexus_5X_API25),我需要获得根访问权限。但是当我输入 adb remount 命令时,它总是告诉我 adb 没有以 root 身份运行。我
这个问题在这里已经有了答案: ADB - Android - Getting the name of the current activity (13 个答案) 关闭 4 年前。 我正在使用 adb
我只是想运行 adb shell,这样我就可以终止进程以进行测试。我在目录 platform-tools 中,adb 可执行文件就在那里。当我尝试运行 shell 时,它说找不到 adb 命令。我正在
我刚刚安装了 android studio 和平台工具,但我无法调用 adb,即使它们显然位于同一目录中。我收到此错误: zsh: command not found: adb 我是 android
以下命令用于使用 Android SDK 工具版本 24.4.1 退出模拟器。将工具版本更新到 25.1.6 后,它在 Mac 上停止工作。 adb -s emulator-5554 emu kill
我正在尝试 root 第 8 代 Kindle HD Fire (Fire OS 6.3.0.1)我已经打开了 Developer options,但是 Enable ADB 没有列在它下面。还有其他
我是一名优秀的程序员,十分优秀!