Posted By

thegeekinside on 10/09/12


Tagged


Versions (?)

Prevent Going Sleep


 / Published in: Java
 

  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();
  6.  

Report this snippet  

You need to login to post a comment.