title: can't make checkbox checked
body: <p>I need your help please to finish my first android project, my objective is to set the status of checkbox depending on preferences, so this is what I tried :</p>
  
  <pre><code>&lt;CheckBox
      android:id="@+id/checkBoxfriendRequests"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:text="   Friend requests"
      android:textSize="23sp"
      android:gravity="center_vertical"
      android:onClick="onCheckboxClicked" /&gt;
  </code></pre>
  
  <p>.</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
       if (savedInstanceState == null) {
              // Add the fragment on initial activity setup
           faceFrag = new FacebookFragment();
              getSupportFragmentManager()
              .beginTransaction()
              .add(android.R.id.content, faceFrag)
              .commit();
          } else {
              // Or set the fragment from restored state info
              faceFrag = (FacebookFragment) getSupportFragmentManager()
              .findFragmentById(android.R.id.content);
          }
  
          ActionBar myActionBar = getSupportActionBar();
          myActionBar.setHomeButtonEnabled(false);
  
          getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); 
          getSupportActionBar().setCustomView(R.layout.abs_layout_face);
  
  
  
          // get view
          LayoutInflater layoutInflater = LayoutInflater.from(FacebookActivity.this);
          final View v = layoutInflater.inflate(R.layout.activity_facebook, null);
  
          // set sharedPrefernces editor
          facePrefs = this.getPreferences(MODE_PRIVATE);
          editor = getPreferences(MODE_PRIVATE).edit();
  
          // checkBoxfriendRequests status
          checkBoxfriendRequests = (CheckBox) v.findViewById(R.id.checkBoxfriendRequests);
  
  
  
          if(facePrefs.getBoolean("friendRequest", false)){
              checkBoxfriendRequests.setChecked(true);
              Log.d("sami","checkbox is cheked");
          }
          else{
              checkBoxfriendRequests.setChecked(false);
              Log.d("sami","checkbox is uncheked");
          }
  
  
  }
  
  
   public void onCheckboxClicked(View view) {
  
          boolean checked = ((CheckBox) view).isChecked();
  
          // Check which checkbox was clicked
          switch(view.getId()) {
              case R.id.checkBoxfriendRequests :
                                      // add to preferences
                  editor.putBoolean("friendRequest", checked );
                  editor.commit();    
                  if(checked) 
                      Log.d("sami", " checked true" );
                  else
                      Log.d("sami", " checked false" );
  
                  break;
          .....
      }
  
  }
  </code></pre>
  
  <p>on activity creation I can see in the LogCat that the checkbox is correctly checked/uncheked but visualy it start always unchecked whatever is the preference parameter.</p>