- 在非Activity跳转页面时使用 context.startActivity()报错
android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
- 如果要使用这种方式跳转页面,需要打开新的TASK,解决方法:
......
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
网友评论