calling startActivity() from ourside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag 错误

使用Intent时
intent =new Intent(getApplicationContext(),Register.class);
时报错
calling startActivity() from ourside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag
改为
intent =new Intent(this,Register.class);
后。可以正常跳转。
Context中有一个startActivity方法,Activity继承自Context,重载了startActivity方法。如果使用 Activity的startActivity方法,不会被限制。
 
posted @ 2013-06-13 16:31  qinyan  阅读(94)  评论(0)    收藏  举报