Setting Screen Brightness Question

rfresh

Well-Known Member
Licensed User
Longtime User
I'm setting my screen brightness using the following code:

B4X:
Dim p As Phone
p.SetScreenBrightness(Value/255)'this sets it in the app only

...and so, I set the screen to a fairly low brightness. That seems to work fine.

Then I touch a button on the screen that loads another Activity. The current screen returns to a brighter setting very fast just before switchong over to the new screen (Activity) and the new screen displays at a higher screen brightness than what I had set previously.

I was hoping to set the screen intensity and have it 'hold' as I selected other screens but it doesn't do that. Is this normal Android OS behavior?

The second question regarding this is that I'm using a seekbar to set the screen intensity and over a period of a few minutes sliding the bar back and forth and returning to the main screen and coming back to the seekbar screen, I see a bunch of slider bars 'behind' the seekbar. These look like past settings I've made. How can I remove them?

Thanks...
 

JonPM

Well-Known Member
Licensed User
Longtime User
I believe the screen brightness only holds for the activity it is in. You would have to call the p.SetScreenBrightness on each activity. You can hold its value in Process_Globals
 
Upvote 0

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
I'm setting my screen brightness using the following code:

B4X:
Dim p As Phone
p.SetScreenBrightness(Value/255)'this sets it in the app only

...and so, I set the screen to a fairly low brightness. That seems to work fine.

Then I touch a button on the screen that loads another Activity. The current screen returns to a brighter setting very fast just before switchong over to the new screen (Activity) and the new screen displays at a higher screen brightness than what I had set previously.

I was hoping to set the screen intensity and have it 'hold' as I selected other screens but it doesn't do that. Is this normal Android OS behavior?

Did you see this: http://www.b4x.com/forum/basic4andr...3021-phone-display-brightness.html#post83857?
 
Upvote 0

rfresh

Well-Known Member
Licensed User
Longtime User
Thanks.

The second question regarding this is that I'm using a seekbar to set the screen intensity and over a period of a few minutes sliding the bar back and forth and returning to the main screen and coming back to the seekbar screen, I see a bunch of slider bars 'behind' the seekbar. These look like past settings I've made. How can I remove them?
 
Upvote 0
Top