码迷,mamicode.com
首页 > 移动开发 > 详细

隐式Intent找不到Activity:android.content.ActivityNotFoundException

时间:2014-11-07 13:17:23      阅读:238      评论:0      收藏:0      [点我收藏+]

标签:android   http   io   ar   sp   for   on   art   问题   

Here is what i encountered: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=me.waye.intentdemo.intent.action.WAYE_ACTION cat=[me.waye.intentdemo.intent.category.WAYE_CATEGORY] } 在学习隐式启动Activity的时候遇到这个错误,用的书是李刚的疯狂Android讲义,书上没有提到这个问题,通过看文档发现了答案:
Android treats all implicit intents passed to startActivity() as if they contained at least one category: " android.intent.category.DEFAULT" (the CATEGORY_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.)
能接受隐式Intent的Activity必须包含android.intent.category.DEFAULT,但LAUNCHER和MAIN例外,可以不用加,也可以加上但没有这个必要。  

隐式Intent找不到Activity:android.content.ActivityNotFoundException

标签:android   http   io   ar   sp   for   on   art   问题   

原文地址:http://my.oschina.net/javaTechLover/blog/341690

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!