My application is running a service . What i want is that , I want screen to awake till my service running in background. I have used this
PowerManager pm;
PowerManager.WakeLock wakeLock;
pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
wakeLock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK,"x2_wakelook");
wakeLock.acquire();
wakeLock.release();
But this code does not work till life span of my service. Screen goes to sleep as soon as i get out of my application. Any help !