@Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.blog_preferences);

    Integer id = getIntent().getIntExtra("id", -1);
    blog = WordPress.getBlog(id);

    if (blog == null) {
      Toast.makeText(this, getString(R.string.blog_not_found), Toast.LENGTH_SHORT).show();
      finish();
      return;
    }

    ActionBar actionBar = getSupportActionBar();
    actionBar.setTitle(StringUtils.unescapeHTML(blog.getBlogName()));
    actionBar.setDisplayHomeAsUpEnabled(true);

    mUsernameET = (EditText) findViewById(R.id.username);
    mPasswordET = (EditText) findViewById(R.id.password);
    mHttpUsernameET = (EditText) findViewById(R.id.httpuser);
    mHttpPasswordET = (EditText) findViewById(R.id.httppassword);
    mScaledImageWidthET = (EditText) findViewById(R.id.scaledImageWidth);
    mFullSizeCB = (CheckBox) findViewById(R.id.fullSizeImage);
    mScaledCB = (CheckBox) findViewById(R.id.scaledImage);
    mLocationCB = (CheckBox) findViewById(R.id.location);
    mImageWidthSpinner = (Spinner) findViewById(R.id.maxImageWidth);

    if (blog.isDotcomFlag()) {
      // Hide credentials section
      RelativeLayout credentialsRL = (RelativeLayout) findViewById(R.id.sectionContent);
      credentialsRL.setVisibility(View.GONE);
    }

    loadSettingsForBlog();
  }