PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "screen"); wl.acquire(); // ..screen will stay on during this section.. //wl.release();
<uses-permission android:name="android.permission.WAKE_LOCK"/>
No comments:
Post a Comment