`
zhouxiaoli521
  • 浏览: 553503 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Android 从Service或者是BroadcastReceiver往Activity跳转时出现的错误

 
阅读更多

错误提示:ERROR/AndroidRuntime(192): java.lang.RuntimeException: Unable to start receiver com.test.hmenu.HMenuReceiver: android.util.AndroidRuntimeException: Calling startActivity () from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? 
(总之出现这样的错误就要setflags(Intent.FLAG_ACTIVITY_NEW_TASK)) 

===========

我也遇到了 记录一下 

解决方法 街上flag

Intent it = new Intent(context,StartActivity.class);

it.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

 

 

 

 

http://qq361119908.iteye.com/blog/631441

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics