Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK fla

来源:互联网 发布:紧急通知域名正在升级 编辑:程序博客网 时间:2024/04/27 21:24
/*在一个Activity中写了如下代码*/mContext=getApplicationContext();mContext.startActivity(intent);

报错
W/System.err: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?

//正确代码 startActivity(intent);
阅读全文
0 0
原创粉丝点击