在Activity的onCreate()中:
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock mWakeLock = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "My Tag");
// onResume() 中调用:
mWakeLock.acquire();
//
mWakeLock.release();
方法二: use the window flag FLAG_KEEP_SCREEN_ON
@Override
protected void onCreate(Bundle icicle) {
}