什么是&QUOT的目的; android.intent.category.DEFAULT"? [英] what is the purpose of "android.intent.category.DEFAULT"?

查看:108
本文介绍了什么是&QUOT的目的; android.intent.category.DEFAULT"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是在已提交的意图过滤器的类别给予android.intent.category.DEFAULT的目的是什么?这是什么意思?

解决方案

类别用于隐含意图

。所以,如果你的活动可能是由一个隐含的意图开始时,没有特定的类别分配给它,它的意图过滤器应包括这一类。(即使你有在意图过滤器其他类别)。如果你确信你的活动必须调用与任何其他类别不使用默认值。

设置类别为默认值并不意味着该活动将默认使用,当你的应用程序启动。该活动只是说系统的哦,我可以启动,即使启动意图的类别设置为没有的了!

what is the purpose of giving "android.intent.category.DEFAULT" in the category filed of intent filters ? what does it mean?

解决方案

Categories are used for implicit Intents. So, If your Activity might be started by an implicit Intent when no specific category is assigned to it, its Intent filter should include this category.( even if you have other categories in the Intent filter). If you are sure that your activity must be called with any other Category don't use the Default.

Setting Category to Default doesn't mean that this Activity will be used by default when your app launches. The Activity just says to system that " Oh I could be started, even if the starter Intent's category is set to Nothing at all ! "

这篇关于什么是&QUOT的目的; android.intent.category.DEFAULT"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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