@Override
 protected void onPreExecute() {
   super.onPreExecute();
   dialog = ProgressDialogFragment.newInstance(getString(R.string.verifying_code));
   dialog.show(getFragmentManager(), "dialog");
   code = codeEdit.getText().toString();
 }
    @Override
    protected void onPostExecute(Void result) {
      super.onPostExecute(result);
      dialog.dismiss();
      Activity activity = getActivity();
      if (activity == null) {
        return;
      }

      if (err_msg != null) {
        Toast.makeText(activity, err_msg, Toast.LENGTH_LONG).show();
      } else {
        Toast.makeText(activity, "Verify code  successfully", Toast.LENGTH_LONG).show();
        updateStatus();
      }
    }
    @Override
    protected void onPostExecute(Void result) {
      super.onPostExecute(result);
      dialog.dismiss();
      Activity activity = getActivity();
      if (activity == null) {
        return;
      }

      if (err_msg != null) {
        Toast.makeText(activity, err_msg, Toast.LENGTH_LONG).show();
      } else {
        Utils.saveToken(activity.getApplicationContext(), token);
        Toast.makeText(activity, "Register successfully", Toast.LENGTH_LONG).show();
        updateStatus();
      }
    }
 @Override
 protected void onPostExecute(Void result) {
   super.onPostExecute(result);
   dialog.dismiss();
   updateStatus();
 }
 @Override
 protected void onPreExecute() {
   super.onPreExecute();
   dialog = ProgressDialogFragment.newInstance(getString(R.string.refreshing_status));
   dialog.show(getFragmentManager(), "dialog");
 }