为什么一个"意向选择"存在的话,它用来做什么? [英] Why does an "Intent Selector" exists, what is it used for?

查看:155
本文介绍了为什么一个"意向选择"存在的话,它用来做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android的意图类提供了一个名为 setSelector 的API。我想了解它的<一个给出的示例href="http://developer.android.com/reference/android/content/Intent.html#setSelector(android.content.Intent)"相对=nofollow>文档。

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

我要问为什么机器人需要添加这个API?什么是打破了这一意向API之前?

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

推荐答案

据我的理解,它给选择的用户他要选择哪个意图。在这个文件,他们已经给它赋予的选择意向的用户是否要打开应用程序的主要活动还是要发动任何差异的应用程序/活性比用户的应用程序等。这是我从该文件的理解。检查此链接,供您参考: https://开头code.google.com/p/android/issues/detail?id=67162 和放大器; <一href="http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android/4.4_r1/android/content/Intent.java#Intent.setSelector%28android.content.Intent%29" rel="nofollow">http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android/4.4_r1/android/content/Intent.java#Intent.setSelector%28android.content.Intent%29

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

这篇关于为什么一个&QUOT;意向选择&QUOT;存在的话,它用来做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆