Prevent Going Sleep

/ Published in: Java
Save to your folder(s)

Copy this code and paste it in your HTML
  1. PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
  2. PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "My Tag");
  3. wl.acquire();
  4. // You code here
  5. wl.release();

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.