Two ways to modify the android sleep time

Source: Internet
Author: User

Method 1,

Sometimes, before the LCD, touchscreen, or keyboard is properly adjusted, Android will suspend in 10 seconds by default, resulting in System sleep. You cannot use the android menu to modify the timeout value. In fact, these Android settings are stored in the SQL database, that is, you can directly modify the database to prevent android from sleep. Sqlite3/data/COM. Android. providers. Settings/databases/settings. DB

Select * from system;

Update System set value = '000000' where name = 'screen _ off_timeout ';

Update System set value = '-1' where name = 'screen _ off_timeout ';

. Exit

Insert into system ('name', 'value') values ('lock _ pattern_autolock', 1 );



Method 2,

Find soundanddisplaysettings. Java

Listpreference screentimeoutpreference =

(Listpreference) findpreference (key_screen_timeout );

// Screentimeoutpreference. setvalue (string. valueof (settings. system. getint (

// Resolver, screen_off_timeout, fallback_screen_timeout_value )));

Screentimeoutpreference. setvalue ("-1 ");

Screentimeoutpreference. setonpreferencechangelistener (this );

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.