Update: I'm sure it is caused by Donut. It works on a 1.5 cupcake device. Is this a bug or can I fix it?
Thank you, Kaloer On 7 Okt., 09:41, kaloer <[email protected]> wrote: > Hi, > > In my last update, I can't change the screen brightness anymore. I > have not changed the code snippet where the brightness is set. Can it > be caused by Donut? > > Here's my code, placed in the onResume() method: > > if (alwaysBacklight) { > WindowManager.LayoutParams lp = > getWindow().getAttributes(); > final PowerManager pm = (PowerManager) > getSystemService > (Context.POWER_SERVICE); > this.mWakeLock = pm.newWakeLock( > PowerManager.SCREEN_BRIGHT_WAKE_LOCK > | > PowerManager.ACQUIRE_CAUSES_WAKEUP, "clockTag"); > this.mWakeLock.acquire(); > int value = screenBrightness; > if (value < 5) > value = 5; > lp.screenBrightness = (float) value / 100; > getWindow().setAttributes(lp); > getWindow().setFlags > (android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, 0); > } --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

