Anybody know that how to wake a phone with any action but without pressing power button or any hard-key and in android programmatically..
Thanks in advance
Anybody know that how to wake a phone with any action but without pressing power button or any hard-key and in android programmatically..
Thanks in advance
Yo can create a wakelock using these two flags
PowerManager.SCREEN_BRIGHT_WAKE_LOCK|PowerManager.ACQUIRE_CAUSES_WAKEUP
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
wakeLock = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK|PowerManager.ACQUIRE_CAUSES_WAKEUP, "wake");
wakeLock .acquire();
This will turn the device to the lockscreen.
Use these flags to get past the lockscreen:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
| WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);