我想在模拟器(API 25)上开始一个白名单应用的活动,但我不断收到一个错误提示:
Caused by: android.content.ActivityNotFoundException:
No Activity found to handle Intent { act=android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS }
这是我的代码:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = new Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
startActivity(intent);
}
有人知道为什么会抛出这个错误吗?