How to wake up the screen...

Quickly share your Android Code Snippets here...

How to wake up the screen...

Postby Insignia » Tue Aug 31, 2010 6:08 pm


Basically, I own a rooted Dell Streak and I'm trying to make an application which recognises when a text arrives and notifies the user by flashing the 3 Home/Menu/Back LEDs in various different patterns. That wasn't much of a problem to code, the only problem is, that they don't light up when the screen has been locked/timed out. Therefore, i've been trying to get my app to power on the screen when an SMS arrives but i have literally tried everything and had no luck whatsoever.

I can remove the lock screen just fine with:
Code: Select all
private synchronized void disableKeyguard() {
        if (mKeyguardLock == null) {
            mKeyguardLock = mKeyguardManager.newKeyguardLock("AlarmClock");

But the screen stays off.
I thought WAKE_LOCK would've worked, but apparently not:
Code: Select all
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock WL1= pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "My Tag");

I made sure WAKE_LOCK permissions are set in the manifest.

I am completely stumped with this, i'm probably just a complete idiot but i've been trying for a few days and i'm completely stuck :(
Any help would be hugely appreciated!

Thanks in advance!
Once Poster
Once Poster
Posts: 1
Joined: Tue Aug 31, 2010 5:31 pm


Return to Code Snippets for Android

Who is online

Users browsing this forum: No registered users and 2 guests