我想通过单击按钮打开电池使用设置。代码是这样的:
Button btnusage = (Button)findViewById(R.id.batteryusage);
Button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openOptionsBatt();
}
});
和方法:
public openOptionsBatt(View v) {
Intent intentBatteryUsage = new Intent(Intent.ACTION_POWER_USAGE_SUMMARY);
startActivity(intentBatteryUsage);
}
应用程序在创建时崩溃.. 为什么?