什么是&QUOT的目的; android.intent.category.DEFAULT"? [英] what is the purpose of "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屋!