Why does an “Intent Selector” exists, what is it u

2019-02-18 23:14发布

问题:

Android's Intent class provides an API called setSelector. I am trying to understand it from the example given in the documentation.

I want to ask that why did Android need to add this API ? What was breaking in Intent before this API ?

回答1:

According to my understanding, it gives choice to user which intent he wants to select. In that documentation they have given that it gives selection of intents whether user wants to open app's main activity or wants to launch any diff app/activity other than user's app. This is what i understood from that documentation. Check this links for your reference : 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