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. Read and modify and write back contacts

Hi,

Any sample code to read all the phone contacts and write them back
after few modifications. I am also looking to add some new fieds to
existing contacts e.g say the call history etc..

Regards,
Nagendra
--~--~---------~--~----~------------~-------~--~----~

2. Android javadoc downloadable

Hi !

Can you please tell us where an Android Javadoc can be downloaded (zip
or others formats) ?
We will have to work with an offline javadoc for a project on this
platform.

Thanks,

Jeff

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

3. Running a program when emulator start

4. License Question...

5. Writing into server database with Android

6. From HelloWorld to Simple Web Browser with Button

7. ImageView too large for placeholder