转载注明出处:http://blog.csdn.net/moushao/article/details/64906321
Android系统,有时候可能需要跳转到系统设置界面,则会报出:
Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
提示我们添加 FLAG_ACTIVITY_NEW_TASK
解决方法:添加下段红色代码
Intent intent = new Intent(Settings.ACTION_DATE_SETTINGS);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);