In Android user can change brightness by “rolling down” the status bar (or notification bar, whatever this is called in Android) and changing brightness there.
I need to display brightness slider in my app. I know how to get system brightness value, but the question is how to know if user changed the brightness? When user rolls-up the notification bar I don’t get onResume. How do I know that the brightness has changed or the notification bar revealed my activity to the user?
Try creating a thread with a runnable that runs indefinitely (or till you want it to run) where you listen for a change in the current brightness. This can be done pretty easily
Find the original screen brightness and assign it to a variable called oldScreenBrightness.
In your thread check