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 8134067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:52:45+00:00 2026-06-06T09:52:45+00:00

WindowManager.LayoutParams.screenBrightness takes a float between 0 and 1. However, it seems that (at least

  • 0

WindowManager.LayoutParams.screenBrightness takes a float between 0 and 1.

However, it seems that (at least on a Nexus S with Gingerbread) setting that value too low forces the screen to turn off completely.

Is there a way to know what the minimum value that can be set without having the screen turn off? Also, is this number constant across devices? If not how can we can retrieve it at runtime?

Here is some example code:

Window window = activity.getWindow();
WindowManager.LayoutParams lp = window.getAttributes();
lp.screenBrightness = 0.01f; // float between 0 and 1
window.setAttributes(lp);

(This is for a in app brightness slider, so I need to know the minimum value to use)

Thanks

  • 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-06T09:52:46+00:00Added an answer on June 6, 2026 at 9:52 am

    I know this is an old question, but google brought me to this post and I thought I’d share my solution. I found this today and it worked for me. I found it here: http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#BRIGHTNESS_OVERRIDE_OFF

    Example:

    Window MyWindow = getWindow();
    WindowManager.LayoutParams winParams = MyWindow.getAttributes();
    winParams.screenBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_OFF;
    MyWindow.setAttributes(winParams);
    

    I hope this helps.

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

Sidebar

Related Questions

this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); Same problem that I've read on other posts. I don't want the soft
Can the TabHost in Android 2.3 be fullscreen ? Usually, I use requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
How can I configure VIM to automatically open WindowManager at startup? That is, how
I'm using: android:theme=@android:style/Theme.Translucent.NoTitleBar in combination with: getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND, WindowManager.LayoutParams.FLAG_BLUR_BEHIND); to get a nice transparent background
Currently, I'm using this to show my application background as phone wallpaper. getWindow().setFlags(WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER, WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER);
I used: getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); How do I resume to Default state (no-keep-on)?
i have my app in fullscreen mode: requestWindowFeature(Window.FEATURE_NO_TITLE); this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); I want to show
I have an android application with a gallery that switches between textswitcher views. It
I mean I write this code : getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); it is run on sony ,samsung...
I want to implement a simple specialized window manager for presentations (not user-controllable) that

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.