码迷,mamicode.com
首页 > 其他好文 > 详细

Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?

时间:2017-04-04 09:32:40      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:pre   tac   clu   错误   call   安卓   .class   ext   app   

安卓出现如下错误,需要增加FLAG_ACTIVITY_NEW_TASK标志

Intent intent1 = new Intent(getApplicationContext(), CameraActivity.class);
intent1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
startActivity(intent1);

  

Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?

标签:pre   tac   clu   错误   call   安卓   .class   ext   app   

原文地址:http://www.cnblogs.com/-Object/p/6664262.html

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