我查找了 Intent 过滤器,发现当“Android通过将 Intent 的内容与设备上其他应用程序的 list 文件中声明的 Intent 过滤器进行比较来找到合适的组件来启动”时,将使用它们(http://developer.android.com/guide/components/intents-filters.html#Building)
在我的 list 文件中,我有
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
从阅读该指南意味着该 Activity 可以通过主要操作和启动器类别来处理隐式 Intent 。
但是,如果我有多个应用程序在 list 文件中具有相同的 Intent 过滤器怎么办?我知道一些隐含的 Intent 将通过主 Action 和启动器类别来调用。 Android 操作系统如何知道选择该应用程序?
最佳答案
当您使用相同的 Intent 过滤器(action=main和category=launcher)定义多个 Activity 时,android会采用该 Intent 过滤器(action=main和category=launcher)在层次结构中定义的第一个 Activity 并将其启动当用户单击应用程序图标时。
关于android - Android 在具有相同操作和类别的多个组件之间有何不同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24625037/