gt:                 .subscribe(new Observer<BaseResponse>() {
context: package org.houxg.leamonax.ui;
  
  
  import android.app.AlertDialog;
  import android.content.DialogInterface;
  import android.content.Intent;
  import android.os.Bundle;
  import android.support.annotation.Nullable;
  import android.support.v7.widget.Toolbar;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.widget.EditText;
  import android.widget.ImageView;
  import android.widget.TextView;
  
  import com.bumptech.glide.Glide;
  import com.raizlabs.android.dbflow.sql.language.SQLite;
  
  import org.houxg.leamonax.BuildConfig;
  import org.houxg.leamonax.R;
  import org.houxg.leamonax.model.Account;
  import org.houxg.leamonax.model.BaseResponse;
  import org.houxg.leamonax.model.Note;
  import org.houxg.leamonax.model.RelationshipOfNoteTag;
  import org.houxg.leamonax.model.Note_Table;
  import org.houxg.leamonax.model.Notebook;
  import org.houxg.leamonax.model.Notebook_Table;
  import org.houxg.leamonax.model.RelationshipOfNoteTag_Table;
  import org.houxg.leamonax.model.Tag;
  import org.houxg.leamonax.model.Tag_Table;
  import org.houxg.leamonax.service.AccountService;
  import org.houxg.leamonax.utils.ToastUtils;
  
  import java.util.List;
  
  import butterknife.BindView;
  import butterknife.ButterKnife;
  import butterknife.OnClick;
  import rx.Observable;
  import rx.Observer;
  import rx.Subscriber;
  import rx.android.schedulers.AndroidSchedulers;
  import rx.functions.Action1;
  import rx.schedulers.Schedulers;
  
  public class SettingsActivity extends BaseActivity {
  
      private final String[] mEditors = new String[]{"RichText", "Markdown"};
  
      @BindView(R.id.tv_editor)
      TextView mEditorTv;
      @BindView(R.id.tv_image_size)
      TextView mImageSizeTv;
      @BindView(R.id.iv_avatar)
      ImageView mAvatarIv;
      @BindView(R.id.tv_user_name)
      TextView mUserNameTv;
      @BindView(R.id.tv_email)
      TextView mEmailTv;
      @BindView(R.id.tv_host)
      TextView mHostTv;
      @BindView(R.id.ll_clear)
      View mClearDataView;
  
      @Override
      protected void onCreate(@Nullable Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_settings);
          initToolBar((Toolbar) findViewById(R.id.toolbar), true);
          ButterKnife.bind(this);
          refresh();
          mClearDataView.setVisibility(BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
      }
  
      @OnClick(R.id.ll_editor)
      void selectEditor() {
          new AlertDialog.Builder(this)
                  .setTitle(R.string.choose_editor)
                  .setSingleChoiceItems(mEditors, AccountService.getCurrent().getDefaultEditor(), new DialogInterface.OnClickListener() {
                      @Override
                      public void onClick(DialogInterface dialog, int which) {
                          dialog.dismiss();
                          Account account = AccountService.getCurrent();
                          account.setDefaultEditor(which);
                          account.update();
                          mEditorTv.setText(mEditors[which]);
                      }
                  })
                  .setCancelable(true)
                  .show();
      }
  
      @OnClick(R.id.ll_log_out)
      void clickedLogout() {
          new AlertDialog.Builder(this)
                  .setTitle(R.string.log_out)
                  .setMessage(R.string.are_your_sure_to_log_out)
                  .setCancelable(true)
                  .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
                      @Override
                      public void onClick(DialogInterface dialog, int which) {
                          dialog.dismiss();
                          AccountService.logout();
                          List<Account> remainingAccount = AccountService.getAccountList();
                          if (remainingAccount.size() == 0) {
                              Intent intent = new Intent(SettingsActivity.this, SignInActivity.class);
                              intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
                              startActivity(intent);
                          }
                          finish();
                      }
                  })
                  .setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
                      @Override
                      public void onClick(DialogInterface dialog, int which) {
                          dialog.dismiss();
                      }
                  })
                  .show();
      }
  
      @OnClick(R.id.rl_avatar)
      void clickedAvatar() {
  
      }
  
      @OnClick(R.id.ll_user_name)
      void clickedUserName() {
          View view = LayoutInflater.from(this).inflate(R.layout.dialog_sigle_edittext, null);
          final EditText mUserNameEt = (EditText) view.findViewById(R.id.edit);
          mUserNameEt.setText(AccountService.getCurrent().getUserName());
          new AlertDialog.Builder(this)
                  .setTitle(R.string.change_user_name)
                  .setView(view)
                  .setCancelable(true)
                  .setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
                      @Override
                      public void onClick(DialogInterface dialog, int which) {
                          dialog.dismiss();
                          String username = mUserNameEt.getText().toString();
                          mUserNameTv.setText(username);
                          changeUsername(username);
                      }
                  })
                  .show();
      }
  
      @OnClick(R.id.ll_change_password)
      void clickedPassword() {
          View view = LayoutInflater.from(this).inflate(R.layout.dialog_change_passowrd, null);
          final EditText mOldPasswordEt = (EditText) view.findViewById(R.id.et_old_password);
          final EditText mNewPasswordEt = (EditText) view.findViewById(R.id.et_new_password);
          new AlertDialog.Builder(this)
                  .setTitle(R.string.change_password)
                  .setView(view)
                  .setCancelable(true)
                  .setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
                      @Override
                      public void onClick(DialogInterface dialog, int which) {
                          dialog.dismiss();
                          changePassword(mOldPasswordEt.getText().toString(), mNewPasswordEt.getText().toString());
                      }
                  })
                  .show();
      }
  
      @OnClick(R.id.ll_clear)
      void clickedClearData() {
          new AlertDialog.Builder(this)
                  .setTitle(R.string.clear_data)
                  .setMessage(R.string.are_you_sure_to_delete_all_data_in_this_account)
                  .setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
                      @Override
                      public void onClick(DialogInterface dialog, int which) {
                          dialog.dismiss();
                      }
                  })
                  .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
                      @Override
                      public void onClick(DialogInterface dialog, int which) {
                          dialog.dismiss();
                          clearData();
                      }
                  })
                  .show();
      }
  
      private void clearData() {
          Observable.create(
                  new Observable.OnSubscribe<Void>() {
                      @Override
                      public void call(Subscriber<? super Void> subscriber) {
                          if (!subscriber.isUnsubscribed()) {
                              Account currentUser = AccountService.getCurrent();
                              SQLite.delete()
                                      .from(Note.class)
                                      .where(Note_Table.userId.eq(currentUser.getUserId()))
                                      .execute();
                              SQLite.delete()
                                      .from(Notebook.class)
                                      .where(Notebook_Table.userId.eq(currentUser.getUserId()))
                                      .execute();
                              SQLite.delete()
                                      .from(Tag.class)
                                      .where(Tag_Table.userId.eq(currentUser.getUserId()))
                                      .execute();
                              SQLite.delete()
                                      .from(RelationshipOfNoteTag.class)
                                      .where(RelationshipOfNoteTag_Table.userId.eq(currentUser.getUserId()))
                                      .execute();
                              Account account = AccountService.getCurrent();
                              account.setNoteUsn(0);
                              account.setNotebookUsn(0);
                              account.update();
                              subscriber.onNext(null);
                              subscriber.onCompleted();
                          }
                      }
                  })
                  .subscribeOn(Schedulers.io())
                  .observeOn(AndroidSchedulers.mainThread())
                  .subscribe(new Action1<Void>() {
                      @Override
                      public void call(Void aVoid) {
                          ToastUtils.show(SettingsActivity.this, R.string.clear_data_successful);
                      }
                  });
      }
  
      private void changeUsername(final String username) {
          AccountService.changeUserName(username)
                  .subscribeOn(Schedulers.io())
                  .observeOn(AndroidSchedulers.mainThread())
  