Keep Screen On & Change Orientation

by naxtek » Thu, 12 Feb 2009 00:19:10 GMT

Sponsored Links
 Hi - After some help with this.

I am making an Android app which is currently coming along nicely -
I've hit upon a couple of stumbling blocks.

1) How do I stop the screen from going dim/off and the phone locking
while the application is running?

2) Can I force the phone to enter landscape mode on running my

Andrew :)

Keep Screen On & Change Orientation

by Dianne Hackborn » Thu, 12 Feb 2009 01:57:35 GMT

 There is a flag in WindowManager.LayoutParams you can set to keep the screen
on.  (Please do NOT use the lower-level PowerManager class for this.)

Use android:screenOrientation on the activity in your manifest to force a
particular orientation mode.

Dianne Hackborn
Android framework engineer

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.


Sponsored Links

Other Threads

1. How to get low-level network data


I've been looking at the API's and didn't found a way to get low-level
network data.

In a GSM network I looking for cellid, lac, rxlev, BCCH channel, BSIC,

And similar information on CDMA/UMTS.

Anyone knows of a way to get this information?

Thank you,



2. Android error


I am trying to use WSDL classes in Android, getting error

Could not find tut10.apk!

Please suggest.




3. AutoCompleteTextView is very ugly

4. Selection Background on ListView...

5. mail.jar activation.jar problem in android

6. Capabilities of Location API

7. How shall I need design my application when the device be rotated?