首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

从Service或者是BroadcastReceiver往Activity跳转时出现的异常

2012-09-19 
从Service或者是BroadcastReceiver往Activity跳转时出现的错误错误提示:ERROR/AndroidRuntime(192): java.

从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))
Intent it = new Intent(context,StartActivity.class);it.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 2 楼 tanghanlin 2011-07-06   http://www.pjprimer.com/view-36790-1.html 3 楼 tanghanlin 2011-07-06   http://www.pjprimer.com/view-36790-1.html 4 楼 zx1989223 2012-05-09   不错不错啊

热点排行