隐式Intent找不到Activity:android.content.ActivityNotFoundException
Android treats all implicit intents passed to能接受隐式Intent的Activity必须包含android.intent.category.DEFAULT,但LAUNCHER和MAIN例外,可以不用加,也可以加上但没有这个必要。startActivity()
as if they contained at least one category: "android.intent.category.DEFAULT
" (theCATEGORY_DEFAULT
constant). Therefore, activities that are willing to receive implicit intents must include "android.intent.category.DEFAULT
" in their intent filters. (Filters with "android.intent.action.MAIN
" and "android.intent.category.LAUNCHER
" settings are the exception. They mark activities that begin new tasks and that are represented on the launcher screen. They can include "android.intent.category.DEFAULT
" in the list of categories, but don‘t need to.) See Using intent matching, later, for more on these filters.)
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。