title: Android switchpreference how can i set the switch preference default value?
body: <p>I have a switch preference and want it to be defaulted "ON"...
  in the xml,</p>
  
  <pre><code>&lt;SwitchPreference
          android:defaultValue="true"
          android:key="PromoNotificationOnOff"
          android:title="@string/Snotification_enable" /&gt;
  </code></pre>
  
  <p>and in class,</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      // Load the preferences from an XML resource
      addPreferencesFromResource(R.xml.settings);
  
  
  }
  </code></pre>
  
  <p>why isn't it working? What is missing? Thanks!!</p>