简体   繁体   中英

How to keep screen from locking but maintain dimming functionality?

I would like to be able to keep the android screen from locking in an application. This is not a marketplace application. It is installed on a dedicated tablet.

The only solution I've found is using the Power Manager and using a WakeLock. This way I can keep the screen from locking, but it also keeps the screen from dimming thus wasting battery.

What I would like is for the screen to dim and turn off the way it always does, but that it is able to wake up when touched and not require the user to press the power button and unlock.

Is this even possible? How would you do something like this?

The only solution I've found is using the Power Manager and using a WakeLock. This way I can keep the screen from locking, but it also keeps the screen from dimming thus wasting battery.

You are perhaps using the wrong WakeLock . Please read the PowerManager documentation and try a different WakeLock . There are WakeLock versions that support anything from the screen being off, to the screen being dim, to the screen being normal brightness.

Is this even possible?

If the screen is off, it will not respond to touch events.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM