In my application I have to enable the device 5 seconds after falling to sleepmode. I have tried different methods like
PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE);
WakeLock wakeLock = powerManager.newWakeLock(PowerManager.ACQUIRE_CAUSES_WAKEUP,
"MyWakelockTag");
But its not working. Anyone please help. Thanks in advance.