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

  • Home
  • SEARCH
  • 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 8088301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:02:59+00:00 2026-06-05T19:02:59+00:00

How do you undim the display programmatically? I may compile upto 100 times a

  • 0

How do you undim the display programmatically?
I may compile upto 100 times a day. And most of the time the screen has dimmed and I must touch the screen to see clearly what change I just made. I do not need to change system brightness just locally. I’ve tried both of these variations to no avail, I still have to touch the screen to bring it to full brightness. Now maybe if I attached a 5 lb weight to my arm there would be some benefit rather than the minor irritation of doing the same thing over and over.
Code Commented out was tried also:

    WindowManager.LayoutParams layout = getWindow().getAttributes();
    layout.dimAmount=1F;
    //screenBrightness = 1F;
    getWindow().setAttributes(layout);
    setContentView(R.layout.main); 
  • 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-06-05T19:03:00+00:00Added an answer on June 5, 2026 at 7:03 pm

    I see two approaches:

    1.The easiest way is to prevent the screen from dimming by using the keepScreenOn attribute. You can set it as a View attribute in your XML, but it is possible programmatically as well (setKeepScreenOn).

    For example, programmatically, you can add this to your Activity’s onCreate() method:

        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);    
    

    2.If you want to deal with dimming/brightness, you can try to set layout.screenBrightness as well. If this approach does not work, it might be because the WindowManager does not know about it (i.e. no refresh happens). There is an accepted stackoverflow answer about it here, I never tested it though.

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

Sidebar

Related Questions

//Edit: Really, nobody has any suggestions or thoughts on this? Have I asked the
I'm not entirely sure what has happened. I was debugging a script that worked
I feel like I must be going crazy, but I just changed the name
Today while programming, I suddenly started to get a JVM Error 104 and the
I use the JUNG API to calculate shortest paths between several nodes in medium
I recently received a PC running Windows 7 for future development as this will
I performed the following actions in TFS: Accidentally made some changes to a bunch
I am trying to add a new row into a gridview but for some
I have an ecommerce site built on OpenCart (1.5.0 i believe), which after inserting
I have a method in controller - def undo_link view_context.link_to(undo, revert_version_path(@page.versions.scoped.last), :method => :post)

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.