Android - 如何查找已安装应用的 Intent)

Android - how to find Intent for installed app(s)

我知道可以从另一个应用程序 (app1) 调用我在设备上安装的应用程序 (app2)。由于 app1 有一个按钮可以调出 app2。有没有办法确定在我的设备上启动 app2 的意图是什么样的?我想修改我自己的应用程序来做同样的事情。

例如,Android 开发者网站上的这个页面向您展示了如何进行隐式 Intent 操作调用。

https://developer.android.com/training/basics/intents/sending

但是,有没有办法发现 Intents/Activities 另一个应用程序 allows/makes-visible 以便我可以调用应用程序 2 并打开它?

App1 takes some contextual data and starts app2 with that data opened to the pertinent page

您假设 app2 有一个 activity 支持一些 Intent 设计来做到这一点。

Is there a way to determine what that Intent looks like to start app2 on my device?

与 app2 的开发人员交谈。

有许多常见的 Intent 结构(ACTION_VIEWACTION_SEND 等)。使用 PackageManager,您可以查明 app2 是否支持其中之一。通过相当复杂的方式,您可以通过多种方式获取清单并找到设备上任何给定 app2 支持的 <intent-filter> 结构。

如果您指的是手动 检查 app2 以查看它支持什么,则可以使用 apps like this one

Can I find out what key/value pairs it supports also?

与 app2 的开发人员交谈。该信息是应用程序的内部信息,不会在清单等地方发布。如果app2刚好是开源的,可以查看源码