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


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

在使用Context的startActivity之前调用

1
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);