Preventing Screen uto Lock while my application is running

by Georgy » Wed, 26 Aug 2009 04:02:46 GMT


Sponsored Links
 Hello,

I read a lot of posts concerning preventing the screen auto lock but
didn't find an efficient way.

Isn't there any simple line I could put to do such a thing? everything
looked so complicated, or didn't work.

thanks
--~--~---------~--~----~------------~-------~--~----~



Preventing Screen uto Lock while my application is running

by Streets Of Boston » Wed, 26 Aug 2009 04:04:03 GMT


 Which ways did not work or were complicated?



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Preventing Screen uto Lock while my application is running

by Georgy » Wed, 26 Aug 2009 04:09:29 GMT


 For example:

   public void onCreate() {
                PowerManager pm = (PowerManager) getSystemService
(Context.POWER_SERVICE);
                PowerManager.WakeLock wl = pm.newWakeLock
(PowerManager.FULL_WAKE_LOCK, "My Tag");
                wl.acquire();
        }

        public void onDestroy() {
                wl.release();
        }




--~--~---------~--~----~------------~-------~--~----~



Preventing Screen uto Lock while my application is running

by Georgy » Wed, 26 Aug 2009 04:12:14 GMT


 I actually read your post Dianne but somehow it doesn't work.

To be more specific I am using the RADAR intent and try to keep the
screen on while navigating to a location.

Thanks




--~--~---------~--~----~------------~-------~--~----~



Preventing Screen uto Lock while my application is running

by Georgy » Wed, 26 Aug 2009 04:13:59 GMT


 hold on I was thinking:

I am calling the radar intent like this:

 Intent i = new Intent("com.google.android.radar.SHOW_RADAR");

could it be that the line of code you mentioned must be in the RADAR
activity? meaning that I cannot control it unless I write the radar
activity that I am referencing all over again???





--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. ListView focus behaving different when using minSdkVersion=3

A few days ago I was trying to fix this issue: I have a header (three
ImageButton's) and a ListView. If I use the dpad, pressing DOWN to
focus the ListView, the ListView shows as selected the seventh or
eighth row, not the first one.

What I need to do is that the first element of the ListView get the
focus (or selection) when I use the dpad, from another screen
component, but instead, the seventh or eighth is selected.

I had minSdkVersion=3 in my manifest. When I changed it to
minSdkVersion=4 it worked as expected (first row selected). Don't know
why, but there is a difference between both.

I'm posting it right here if someone else has the same problem as me.
The fring application has the very same problem in contact list.


Salud,
Rodrigo

-- 

2. OOT: survey kecil2an dan minta masukan

Penasaran aja berapa banyak member disini yang mantan pengguna bb dan udah 
beralih total ke android?

Terus gimana caranya?
sent from jave....just normal jave....

-- 
"Indonesian Android Community [id-android]" 

3. Is there another way to show soft keyboard automatically?

4. Streaming "LIVE" from Axis encoder (via VLC) to android

5. Is it possible to develop and upload Android 2.1 apps onto Motorola backflip?

6. Implement Camera Support for Android Emulator using Web Cam

7. shell commands in android - documentation