title: cannot set brightness for application
body: <p>I'm writing an app to change screen brightness with seekbar and I use this code on event onProgressChanged</p>
  
  <pre><code>Settings.System.putInt(getApplicationContext().getContentResolver(),Settings.System.SCREEN_BRIGHTNESS,newBrightness);
  </code></pre>
  
  <p>but the application crashed after this code. I also added </p>
  
  <p><code>&lt;uses-permission android:name="android.permission.WRITE_SETTINGS"/&gt;</code> to Manifest</p>
  
  <p>Does anyone know why? please help me</p>
  
  <p>Thanks in advance</p>