title: Login with Google Plus after I can't logout
body: <p>I'm trying to Sign in my application with Google Plus. First time when I try, It ask me permission and I accept it. After I go to my Google Plus profile and delete my application. Now I try to re-sign in but it doesn't ask me any permission. If I add to new scope in GoogleApiClient configuration it ask me again.. </p>
  
  <p>How can I clear my phone permanently my application?</p>
  
  <p>I try like this;</p>
  
  <pre><code>if(mGoogleApiClient.isConnected()){
              Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);
              mGoogleApiClient.disconnect();
              mGoogleApiClient.connect();
              Log.d("deneme", "Google Profile shutdown");
          }
          else
              Log.d("deneme", "Google already shutdown");
  </code></pre>
  
  <p>And another problem, I'm try to get user' s profile information like this, I got error.</p>
  
  <pre><code>@Override
  public void onConnected(Bundle connectionHint) {
      mSignInClicked = false;
      Log.d("deneme", "onConnected");
      if(mGoogleApiClient.isConnected()){
          Person currentPerson = Plus.PeopleApi.getCurrentPerson(mGoogleApiClient);
          if(currentPerson.isPlusUser())
              Log.d("deneme", currentPerson.getDisplayName());
      }
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/XzYSZ.png" alt="enter image description here"></p>
  
  <pre><code>public class NotRegistered extends SherlockFragment implements View.OnClickListener, ConnectionCallbacks, OnConnectionFailedListener {
  
  @Override
  public void onStart() {
      super.onStart();
      mGoogleApiClient.connect();
      Log.d("deneme","onStart");
  }
  
  @Override
  public void onStop() {
      super.onStop();
      if(mGoogleApiClient.isConnected()){
          mGoogleApiClient.disconnect();
          Log.d("deneme","onStop");
      }
  }
  
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
      Log.d("deneme", "onActivityCreated");
      super.onActivityCreated(savedInstanceState);
      ViewFlipper vf = (ViewFlipper) getActivity().findViewById(R.id.viewFlipper1);
      vf.setFlipInterval(11000);
      vf.startFlipping();
  
      Button b_gmail = (Button) getActivity().findViewById(R.id.BTN_sign_gmail);
      Button m_loginButton = (Button) getActivity().findViewById(R.id.BTN_register);
      Button m_registerButton = (Button) getActivity().findViewById(R.id.BTN_login);
  
      getActivity().findViewById(R.id.sign_in_button).setOnClickListener(this);
  
      mSignInButton = (SignInButton) getActivity().findViewById(R.id.sign_in_button);
      mSignInButton.setOnClickListener(this);
  
      b_facebook = (LoginButton) getActivity().findViewById(R.id.BTN_sign_facebook);
      b_facebook.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
      b_facebook.setReadPermissions(Arrays.asList("user_likes", "email", "user_status", "user_about_me"));
      b_facebook.setBackgroundResource(R.drawable.login_facebook_button);
      b_facebook.setFragment(this);
  
      m_loginButton.setOnClickListener(this);
      m_registerButton.setOnClickListener(this);
      b_gmail.setOnClickListener(this);   
  }
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
      Log.d("deneme", "Not Register onCreateView");
      View view;
      view = inflater.inflate(R.layout.notregistered_fragment, container, false);
      uiHelper = new UiLifecycleHelper(getActivity(), callback);
      uiHelper.onCreate(savedInstanceState);
  
      mGoogleApiClient = new GoogleApiClient.Builder(getActivity().getApplicationContext())
          .addApi(Plus.API, null)
          .addScope(Plus.SCOPE_PLUS_LOGIN)
          .addConnectionCallbacks(this)
          .addOnConnectionFailedListener(this)
          .build();
      return view;
  }
  
  private void onSessionStateChange(Session session, SessionState sessionState, Exception exception){
      if(sessionState.isOpened()){
          Log.d("deneme", "Oturum Açık");
          Log.d("deneme", session.getAccessToken());
          //boolean returnVal = new UserRecord().execute(val);
          makeMeRequest(session);
              Intent i = new Intent(getActivity(), Pager.class);
              startActivity(i);
              getActivity().finish();
      } else {
          Log.d("deneme", "Oturum Kapalı");
      }
  }
  
  private void makeMeRequest(final Session session) {
      Request request = Request.newMeRequest(session, new Request.GraphUserCallback() {
          @Override
          public void onCompleted(GraphUser user, Response response) {
              if (session == Session.getActiveSession()) {
                  if (user != null) {
                      new NewUserAsync().execute("facebook", user.getUsername(), user.getFirstName(), 
                              user.getLastName(), user.getProperty("email").toString(), user.getId(),
                              user.getBirthday().toString());
                  }
              }
              if (response.getError() != null) {
                  Log.d("deneme",response.getError().toString());
              }
          }
      });
      request.executeAsync();
  
  }
  
  
  private Session.StatusCallback callback = new Session.StatusCallback() {
  
      @Override
      public void call(Session session, SessionState state, Exception exception) {
          Log.d(TAG, "callback");
          onSessionStateChange(session, state, exception);
      }
  };
  
  @Override
  public void onClick(View v) {
      Register register = new Register();
      switch (v.getId()) {
      case R.id.BTN_sign_gmail:
          if(mGoogleApiClient.isConnected()){
              Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);
              mGoogleApiClient.disconnect();
              mGoogleApiClient.connect();
              if(mGoogleApiClient.isConnected())
                  Log.d("deneme", "Google profili sonlandırılamadı");
              else
                  Log.d("deneme", "Google profili sonlandırıldı");
          } else
              Log.d("deneme", "Oturum zaten kapalı");
          break;
      case R.id.BTN_register:
          getActivity().getSupportFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.test, register, "register").commit();
          break;
      case R.id.BTN_login:
          Intent i = new Intent(getActivity().getApplicationContext(), Pager.class);
          startActivity(i);
          //getActivity().getSupportFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.test, register, "register").commit();
          break;
      case R.id.sign_in_button:
          if(!mGoogleApiClient.isConnecting()){
              mSignInClicked = true;
              resolveSignInError();
              Toast.makeText(getActivity(), "küçük buttona tıklandı", Toast.LENGTH_LONG).show();
          }
  
          break;
      default:
          break;
      }
  }
  
  @Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
      uiHelper.onActivityResult(requestCode, resultCode, data);
      Log.d("deneme", "onActivityResult");
  
      if(requestCode == RC_SIGN_IN){
          if(resultCode != getActivity().RESULT_OK){
              mSignInClicked = false;
          }
      }
  
      mIntentInProgress = false;
      if(!mGoogleApiClient.isConnecting()){
          mGoogleApiClient.connect();
      }
  }
  
  @Override
  public void onDestroy() {
      super.onDestroy();
      uiHelper.onDestroy();
      Log.d("deneme", "onDestroy");
  }
  
  @Override
  public void onPause() {
      super.onPause();
      uiHelper.onPause();
      Log.d("deneme", "onPause");
  }
  
  @Override
  public void onResume() {
      super.onResume();
      uiHelper.onResume();
      Log.d("deneme", "onResume");
  }
  
  @Override
  public void onSaveInstanceState(Bundle outState) {
      super.onSaveInstanceState(outState);
      uiHelper.onSaveInstanceState(outState);
      Log.d("deneme", "onSaveInstanceState");
  }
  
  public static final String TAG = "deneme";
  private LoginButton b_facebook;
  private UiLifecycleHelper uiHelper;
  
  // Google Plus Connect Starting
  
  @Override
  public void onConnected(Bundle connectionHint) {
      mSignInClicked = false;
      Toast.makeText(getActivity(), "Kullanıcı bağlı", Toast.LENGTH_LONG).show();
      Log.d("deneme", "onConnected");
  }
  
  @Override
  public void onConnectionSuspended(int cause) {
      mGoogleApiClient.connect();
  }
  
  @Override
  public void onConnectionFailed(ConnectionResult result) {
      if(!mIntentInProgress){
          mConnectionResult = result;
          if(mSignInClicked){
              resolveSignInError();
          }
      }
  }
  
  private void resolveSignInError() {
      Log.d("deneme", "Buraya bir geldi : resolveSignInError");
        if (mConnectionResult.hasResolution()) {
          try {
            mIntentInProgress = true;
            mConnectionResult.startResolutionForResult(getActivity(), RC_SIGN_IN);
            Log.d("deneme", "resolveSignInError try içerisinde");
          } catch (SendIntentException e) {
            mIntentInProgress = false;
            mGoogleApiClient.connect();
            Log.d("deneme", "resolveSignInError catch içerisinde");
          }
        }
      }
  
  SignInButton mSignInButton;
  GoogleApiClient mGoogleApiClient;
  ConnectionResult mConnectionResult;
  boolean mIntentInProgress = false;
  boolean mSignInClicked;
  int RC_SIGN_IN = 0;
  }
  </code></pre>
  
  <p>Line 241 : public void onConnectionSuspended(int cause) function.</p>
  
  <p>Firstly, How can I remove my test users and how can I get their profile information.. </p>
  
  <p>Thank you for help..</p>