Screen Timeout

annnabellaaaxo

New member
Hi, I have a problem with the available options on my android device emulator. I would like to disable the screen timeout. Unfortunately the screen timeout only gives one the options to set the time when the timeout should automatically be activated.

I need to know how to change the default options. How can I add the option to the settings, which enables me to set the screen timeout to never?

Help is much appreciated.
 
I'm not sure what you mean by this. In my emulator the menus are exactly the same as on my phone. In the emulator I just go to Menu -> Settings -> Sound & display -> Screen timeout -> (scroll down to Never) and select Never.
 
Thanks For your answer.

The never option is not available. The options are from 15 secs to 30 min.

After the android device, we are experementing with, boots one is forced to unlock the device to enable usage. How can we avoid the unlock procedure.

Does anybody know how to programmatically eliminate the automatic time out feature.
 
Curious... mine goes 10 minutes then Never Timeout.

What version of Android are you running on the emulator? I'm just looking at the simple_avd with 1.5 on it.
 
Ok, ive got the 2.1 version. That explains it. They should have not elimated that option. Why did they do so? I need that option how can I programmatically achieve this?
 
Yep, that's it. I just checked on my 2.1 AVD and I get the same menu as you.

So something like this (off the top of my head, not tested it or anything, so check it actually works in various versions):

Code:
import android.content.ContentResolver;
import static android.provider.Settings.System.SCREEN_OFF_TIMEOUT;

// Get the current screen timeout...
int screenTimeoutMillis=android.provider.Settings.System.getInt(getContentResolver(), SCREEN_OFF_TIMEOUT);

// Set screen timeout to 10 seconds...
int newTimeoutTime = 10 * 1000;
android.provider.Settings.System.putInt(getContentResolver(), SCREEN_OFF_TIMEOUT, newTimeoutTime);

// Set the screen to never timeout...
android.provider.Settings.System.putInt(getContentResolver(), SCREEN_OFF_TIMEOUT, -1);
 
Back
Top