title: Android - uncheck a SwitchPreference when it has been toggled on?
body: <p>I essentially want to do the following:</p>
  
  <pre><code> switch.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
              @Override
              public boolean onPreferenceChange(Preference preference, Object newValue) {
                  Boolean newVal = (Boolean) newValue;
                  if (newVal &amp;&amp; Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M &amp;&amp; !Settings.canDrawOverlays(getApplicationContext())) {
                      switch.setChecked(false);
                      displaySettingsDialog(); 
                      return true;
                  }
  </code></pre>
  
  <p><code>switch.setChecked(false);</code> does not appear to execute, and the switch will toggle on while <code>displaySettingsDialog()</code> happens. How do I get around this?  </p>