i am using Samsung Galaxy Note. When my phone is in locked state, and when i click the power button i see the pattern unlocking screen. When new messages flow in, i just see a mail icon in the top status bar, but no other notifications in the screen. what needs to be done for that?
Asked
Active
Viewed 361 times
1 Answers
0
You have to wakeup the device when push message came.
onMesaage method of GCM service you have to call below code
public abstract class WakeLocker {
private static PowerManager.WakeLock wakeLock;
public static void acquire(Context ctx) {
if (wakeLock != null) wakeLock.release();
PowerManager pm = (PowerManager) ctx.getSystemService(Context.POWER_SERVICE);
wakeLock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK |
PowerManager.ACQUIRE_CAUSES_WAKEUP |
PowerManager.ON_AFTER_RELEASE, MainActivity.APP_TAG);
wakeLock.acquire();
}
public static void release() {
if (wakeLock != null) wakeLock.release(); wakeLock = null;
}
}
See the below link