title: Checkbox Preference and Checking if its enabled or disable
body: <p>Im having issues with the below code on making a checkbox preference, That by default is checked. My first activity is a simple splash screen, and simply before show my imageview thread i want to check if the checkbox has been disable if so then i want to intent directly to the main activity and by default i show my image thread, or in reversed order of that. </p>
  
  <p>Currently my splashscreen is launching no matter if its checked or now, Any help would be greatly appreciated</p>
  
  <h2>XML</h2>
  
  <pre><code> &lt;CheckBoxPreference
        android:title="@string/category_tools_startupscreen"
        android:summary="@string/category_tools_startupscreen_summary"
        android:key="boot_animation" android:order="5" android:enabled="true"/&gt;
  </code></pre>
  
  <h2>SplashScreen</h2>
  
  <pre><code>   SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
  
      if (settings.getBoolean("boot_animation", true)) {
          setContentView(R.layout.splash_screen);
          Thread splashThread = new Thread() {
              @Override
              public void run() {
                  try {
                      int waited = 0;
                      // changed from 5000 to 4000 11.29
                      while (waited &lt; 3000) {
                          sleep(100);
                          waited += 100;
                      }
                  } catch (InterruptedException e) {
                      // do nothing
                  } finally {
                      Intent i = new Intent();
                      i.setClassName("com.example.app",
                              "com.example.app.MainActivity");
                      startActivity(i);
                      finish();
                  }
              }
          };
          splashThread.start();
      }
  
      else {
          Intent i = new Intent();
          i.setClassName("com.example.app",
                  "com.example.app.MainActivity");
          startActivity(i);
          finish();
      }
  
  }
  </code></pre>
  
  <h2>Settings</h2>
  
  <pre><code>    final CheckBoxPreference checkboxPref2 = (CheckBoxPreference) getPreferenceManager().findPreference("boot_animation");
  
              checkboxPref2.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {            
                   public boolean onPreferenceChange(Preference preference, Object newValue) {
                  if(newValue instanceof Boolean){
                          Boolean boolVal = (Boolean)newValue;
                          SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
                          SharedPreferences.Editor editor = settings.edit();
                          editor.putBoolean("checked", boolVal);
                          editor.commit();
                      }
                      return true;
                  }
              }); 
  </code></pre>