I have a service running for my application to send notification every hour. This is working fine as i heard a sound and a vibration every hour because of my notification but i also want that my notification light up my screen as well. But i am unable to light up my screen when notification appears.
On Android: Settings > Accessibility > Hearing > turn on Flash Notification.
Method 4: (For Android 11-based phones) You just have to go to the App Info section of the Phone/Dialer app. Press the app icon and click on the (i) icon for that. Thereafter click on Notifications and ensure All Phone Notifications are turned on.
From Settings, tap Notifications, and then tap Brief pop-up settings. Tap Edge lighting style, and then customize your desired options. When you're finished, tap Done to set your changes.
PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE); boolean isScreenOn = pm.isScreenOn(); Log.e("screen on.................................", ""+isScreenOn); if(isScreenOn==false) { WakeLock wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK |PowerManager.ACQUIRE_CAUSES_WAKEUP |PowerManager.ON_AFTER_RELEASE,"MyLock"); wl.acquire(10000); WakeLock wl_cpu = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,"MyCpuLock"); wl_cpu.acquire(10000); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With