NotifyMe icon indicating copy to clipboard operation
NotifyMe copied to clipboard

Little tip

Open antoxa2584x opened this issue 7 years ago • 0 comments

Hi, I checked your code. I worked on project with mandatory notification at any time. Your notification will be not shown while device is sleeping if you not wrap it in this -

            PowerManager.WakeLock wakeLock = null;

            if (powerManager != null) {
                wakeLock = powerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK
                        | PowerManager.ACQUIRE_CAUSES_WAKEUP
                        | PowerManager.ON_AFTER_RELEASE, TAG);
            }

            if (wakeLock != null)
                wakeLock.acquire(500);

            //SHOW NOTIFICATION CODE

            if (wakeLock != null)
                wakeLock.release();

antoxa2584x avatar Jul 04 '18 13:07 antoxa2584x