Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3694198
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:28:05+00:00 2026-05-19T04:28:05+00:00

This question sounds so easy I can’t believe I can’t find information on it

  • 0

This question sounds so easy I can’t believe I can’t find information on it (maybe I have the wrong key words in mind…)

I’m looking for a way to change the delay before the phone is put to sleep when my app is running.

I was using wake locks until now to prevent my app from being closed to frequently (its and opengl app and the loading time is a killer specially on slow phones).
I don’t like the idea of indefinitely leaving the phone on (mainly because it empties the battery fast to have a full opengl app running).

Is there a way then to change the delay before the phones goes to sleep to 2~3min ?

I would also like to add that I do not wish to change the settings of the phone (that is only the users decision)

Jason

edited to correct the term “application going to sleep” which was pointed out as being incorrect.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:28:05+00:00Added an answer on May 19, 2026 at 4:28 am

    Create a Timer object and release() your wake lock in the timer task. I’m relatively sure you can release a lock in a worker thread, but worst case, you’d need to use runOnUiThread if I’m incorrect.

    Be sure to handle the case when onPause() is called and cancel your timer in that case and release the lock immediately.

    In general, I’m not a fan of wake locks, but if this is to make your boss happy, wake-lock away.

    EDIT: Btw, the system setting for the UI timeout is accessible by apps: SCREEN_OFF_TIMEOUT in android.provider.Settings.System. But really, this is for private applications only, public applications have no business changing this value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This may sounds like a stupid question but can't find anything on google, probably
This sounds like a simple enough question, but can't find the answer for the
this might question might sounds stupid, but I could'nt figure it out. How can
I am new to jQuery and so don't mind this question if it sounds
I know the question sounds silly, but consider this: I have an array of
I know this sounds like an easy question but for some reason I just
Ok hopefully this is an easy question: I have a main viewcontroller that is
This sounds like a pretty easy question to answer but I haven't been able
This question sounds outrageous, but VS is giving me an error when I check
So I realize this question sounds stupid (and yes I am using a dual

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.