gt:             if (responseCode != Activity.RESULT_OK) {
context: package com.xda.one.auth;
  
  import com.squareup.otto.Subscribe;
  import com.xda.one.R;
  import com.xda.one.api.inteface.UserClient;
  import com.xda.one.api.retrofit.RetrofitUserClient;
  import com.xda.one.event.user.UserLoginEvent;
  import com.xda.one.event.user.UserLoginFailedEvent;
  import com.xda.one.ui.listener.MultipleNonEmptyTextViewListener;
  import com.xda.one.util.FragmentUtils;
  
  import android.app.Activity;
  import android.app.ProgressDialog;
  import android.content.Intent;
  import android.os.Bundle;
  import android.support.annotation.Nullable;
  import android.support.v4.app.Fragment;
  import android.support.v4.app.FragmentTransaction;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.Button;
  import android.widget.EditText;
  import android.widget.Toast;
  
  public class LoginFragment extends Fragment implements View.OnClickListener {
  
      public final static String ARG_ACCOUNT_NAME = "ACCOUNT_NAME";
  
      /* Request code used to invoke sign in user interactions. */
      private static final int RC_SIGN_IN = 0;
  
      private UserClient mUserClient;
  
      private EditText mUsername;
  
      private EditText mPassword;
  
      private View mLogin;
  
      private Object mEventListener;
  
      private ProgressDialog mProgressDialog;
  
      private String mAccountName;
  
      /* Client used to interact with Google APIs. */
      // private GoogleApiClient mGoogleApiClient;
  
      /* A flag indicating that a PendingIntent is in progress and prevents
       * us from starting further intents.
       */
      private boolean mIntentInProgress;
  
      /*
       * Track whether the sign-in button has been clicked so that we know to resolve
       * all issues preventing sign-in without waiting.
       */
      private boolean mSignInClicked;
  
      /* Store the connection result from onConnectionFailed callbacks so that we can
       * resolve them when the user clicks sign-in.
       */
      // private ConnectionResult mConnectionResult;
  
      public static Fragment createInstance(final String accountName) {
          final Bundle bundle = new Bundle();
          bundle.putString(ARG_ACCOUNT_NAME, accountName);
  
          final LoginFragment loginFragment = new LoginFragment();
          loginFragment.setArguments(bundle);
          return loginFragment;
      }
  
      @Override
      public void onCreate(final Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          mUserClient = RetrofitUserClient.getClient(getActivity());
  
          mAccountName = getArguments().getString(ARG_ACCOUNT_NAME);
  
          mProgressDialog = new ProgressDialog(getActivity());
          mProgressDialog.setTitle("Logging in...");
          mProgressDialog.setMessage("Logging in...");
          mProgressDialog.setIndeterminate(true);
          mProgressDialog.setCancelable(false);
          mProgressDialog.setCanceledOnTouchOutside(false);
  
          /*mGoogleApiClient = new GoogleApiClient.Builder(getActivity())
                  .addConnectionCallbacks(this)
                  .addOnConnectionFailedListener(this)
                  .addApi(Plus.API)
                  .build();*/
      }
  
      @Override
      public void onDestroy() {
          super.onDestroy();
  
          if (mEventListener != null) {
              mUserClient.getBus().unregister(mEventListener);
          }
      }
  
      @Override
      public View onCreateView(final LayoutInflater inflater, @Nullable final ViewGroup container,
              @Nullable final Bundle savedInstanceState) {
          return inflater.inflate(R.layout.login_fragment, container, false);
      }
  
      @Override
      public void onViewCreated(final View view, @Nullable final Bundle savedInstanceState) {
          mLogin = view.findViewById(R.id.submit);
          mLogin.setEnabled(false);
          mLogin.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  submit();
              }
          });
  
          // view.findViewById(R.id.sign_in_button).setOnClickListener(this);
  
          mUsername = (EditText) view.findViewById(R.id.accountName);
          mUsername.setText(mAccountName);
  
          mPassword = (EditText) view.findViewById(R.id.accountPassword);
  
          final MultipleNonEmptyTextViewListener listener = new MultipleNonEmptyTextViewListener
                  (mLogin, mUsername, mPassword);
          listener.registerAll();
  
          final Button register = (Button) view.findViewById(R.id.register);
          register.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(final View v) {
                  final FragmentTransaction transaction = FragmentUtils
                          .getDefaultTransaction(getFragmentManager());
                  transaction.replace(R.id.frame_activity_content, RegisterFragment.createInstance())
                          .addToBackStack(null)
                          .commit();
              }
          });
      }
  
      @Override
      public void onStart() {
          super.onStart();
  
          // mGoogleApiClient.connect();
      }
  
      @Override
      public void onStop() {
          super.onStop();
  
          /*if (mGoogleApiClient.isConnected()) {
              mGoogleApiClient.disconnect();
          }*/
      }
  
      public void submit() {
          final String userName = mUsername.getText().toString();
          final String userPass = mPassword.getText().toString();
  
          mProgressDialog.show();
  
          mEventListener = new EventListener();
          mUserClient.getBus().register(mEventListener);
          mUserClient.login(userName, userPass);
      }
  
      /* A helper method to resolve the current ConnectionResult error. */
      /*private void resolveSignInError() {
          if (mConnectionResult.hasResolution()) {
              try {
                  mIntentInProgress = true;
                  mConnectionResult.startResolutionForResult(getActivity(), RC_SIGN_IN);
              } catch (IntentSender.SendIntentException e) {
                  // The intent was canceled before it was sent.  Return to the default
                  // state and attempt to connect to get an updated ConnectionResult.
                  mIntentInProgress = false;
                  mGoogleApiClient.connect();
              }
          }
      }
  
      @Override
      public void onConnectionFailed(ConnectionResult result) {
          if (!mIntentInProgress) {
              // Store the ConnectionResult so that we can use it later when the user clicks
              // 'sign-in'.
              mConnectionResult = result;
  
              if (mSignInClicked) {
                  // The user has already clicked 'sign-in' so we attempt to resolve all
                  // errors until the user is signed in, or they cancel.
                  resolveSignInError();
              }
          }
      }*/
  
      @Override
      public void onClick(View view) {
          /*if (view.getId() == R.id.sign_in_button && !mGoogleApiClient.isConnecting()) {
              mSignInClicked = true;
              resolveSignInError();
          }*/
      }
  
      @Override
      public void onActivityResult(int requestCode, int responseCode, Intent intent) {
          super.onActivityResult(requestCode, responseCode, intent);
  
          if (requestCode == RC_SIGN_IN) {
  