为什么存在“意图选择器”,它的用途是什么?

Jak*_*ake 5 android android-intent

Android 的 Intent 类提供了一个名为setSelector. 我试图从文档中给出的示例中理解它。

我想问一下,为什么Android需要添加这个API?在这个 API 之前,Intent 有什么问题?

VVB*_*VVB -1

根据我的理解,它让用户选择他想要选择的意图。在该文档中,他们给出了用户是否想要打开应用程序的主要活动或想要启动除用户应用程序之外的任何差异应用程序/活动的意图选择。这是我从该文档中了解到的。检查此链接以供参考: https://code.google.com/p/android/issues/detail ?id=67162 & http://grepcode.com/file/repository.grepcode.com/java/ext/com .google.android/android/4.4_r1/android/content/Intent.java#Intent.setSelector%28android.content.Intent%29