public PowerManager pm;
public PowerManager.WakeLock mWakeLock;
(2)onCreate中调用自定义的initData():
pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "myLock");
(3)onResume():
mWakeLock.acquire();
(4)onPause()或者onDestroy():根据具体情况
mWakeLock.release();
//电源控制权限