Categories

Archives

Changing the Screen Brightness Programatically in Cupcake

For list of android tutorial click here

Previously we had blogged about on how to change the screen brightness in android pre cupcake and on cupcake, the android team had added an official way to change the brightness without the hacks. Here is how to use it:

WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.screenBrightness = 100 / 100.0f;
getWindow().setAttributes(lp);

References:
http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#screenBrightness
http://groups.google.com/group/android-developers/browse_thread/thread/6de1cb84596a1c9b

Related posts:

  1. Changing the Screen Brightness Programatically
  2. Cupcake on my Android
  3. WebView with ZoomControls in Android
  4. Permissions Journey: ACCESS_COARSE_LOCATION
  5. Changing Activity in Android

5 comments to Changing the Screen Brightness Programatically in Cupcake

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>