title: Update Display Brightness on Android after changing it programmatically
body: <p>I'm trying to update the display brightness from a widget but i have some problems.</p>
  
  <p>To change brightness level, i use:</p>
  
  <pre><code>Settings.System.putInt(context.getContentResolver(),android.provider.Settings.System.SCREEN_BRIGHTNESS, 200);
  </code></pre>
  
  <p>This modifies the display setting (in fact in Display->Brightness the level is correct) but the effective brightness of display is not changed. If i lock the screen and unlock, the brightness finally changes to the value i set.</p>
  
  <p>I assume this is a Settings Update issue, so how can the display settings be immediatly updated after settings change?</p>
  
  <p>I read that <code>WindowManager.LayoutParams lp = getWindow().getAttributes();</code> should be used but I am working in a App Widget so getWindow() cannot be called.</p>