title: How to detect if screen brightness has changed in Android?
body: <p>I have searched extensively and couldn't find a similar question.</p>
  
  <p>I would like to know if there is any way to detect when the screen brightness of a mobile device has been changed. </p>
  
  <p>I have already tried to store the old value when the app starts and repeatedly check using<code>Settings.System.getInt(getContentResolver(),Settings.System.SCREEN_BRIGHTNESS);</code> to compare the initial and final value of screen brightness , which is not a good way of doing so.</p>
  
  <p>Thanks</p>
  
  <p>EDIT: This question states that I have already tried the solution of using <code>Settings.System.SCREEN_BRIGHTNESS</code> to get current screen values and periodically check for screen brightness changes. I am looking for a more efficient way of doing such an operation.</p>