【发布时间】:2016-01-21 12:36:25
【问题描述】:
今天我在地图中创建了一个应用程序,但是当电池保护程序打开时它崩溃了。
如何在电池保护程序开启时检查事件,对于每台设备,帮助我。谢谢
我试试这个,但在 API
PowerManager powerManager = (PowerManager)
this.getSystemService(Context.POWER_SERVICE);
if ( powerManager.isPowerSaveMode()) {
// Animations are disabled in power save mode, so just show a toast instead.
Toast.makeText(customer_textReport.this, "Vui lòng tắt chế độ tiết kiệm pin", Toast.LENGTH_SHORT).show();
}
else {
Intent intentvitri = new Intent(customer_textReport.this, CustomerGetLocation.class);
startActivityForResult(intentvitri, 111);
}
【问题讨论】:
标签: android