您的位置:首页 > 移动开发 > Android开发

android.app.ContextImpl.startActivity(ContextImpl.java:617)

2011-12-01 21:37 746 查看
android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
at android.app.ContextImpl.startActivity(ContextImpl.java:617)

貌似在startActivity之前要加个标记:
intent.addFlag(Intent.FLAG_ACTIVITY_NEW_TASK),无论是在activity类中,还是在其它组件类中都需要加这句话,
异常信息中已经说明了,需要FLAG_ACTIVITY_NEW_TASK intent.addFlag(Intent.FLAG_ACTIVITY_NEW_TASK)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐