Code example for PowerManager.WakeLock

Methods: acquire

0
		} 
		 
		if (mWakeLock == null) {
    		PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
            mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "SyncMyPix WakeLock");
            mWakeLock.acquire();
    	} 
	} 
	 
	public static void releaseWakeLock() { 
    	if (mWakeLock != null) {
    		mWakeLock.release();
    		mWakeLock = null;
    	} 
	} 
}