6

I have implemented google plus in my application and when I sign in via google plus then my app show all the google account which are sync in my android device. My problem is that when I sign out from google plus and again sign in then my app doesn't ask for choose account(do not show all the google accounts sync in my android device), It only shows for the first time I install the application and my app directly sign in to the account I choose at the first time of login. I am attaching my logout code. I have spent lot of time on this issue but didn't find any solution.

private void signOutFromGplus() {
    if (SignInActivity.mGoogleApiClient.isConnected()){
        Plus.AccountApi.clearDefaultAccount(SignInActivity.mGoogleApiClient);
        SignInActivity.mGoogleApiClient.disconnect();
        SignInActivity.mGoogleApiClient.connect();
    }
 }
rahul
  • 2,613
  • 8
  • 32
  • 55
  • 1
    For that u need to revoke the Google+ access. Check this link http://www.androidhive.info/2014/02/android-login-with-google-plus-account-1/ – Kavin Prabhu Nov 06 '14 at 13:56
  • thanks for you reply I applied revoke google+ but still the issue remains if (mGoogleApiClient.isConnected()) { Plus.AccountApi.clearDefaultAccount(mGoogleApiClient); Plus.AccountApi.revokeAccessAndDisconnect(mGoogleApiClient) .setResultCallback(new ResultCallback() { @Override public void onResult(Status arg0) { Log.e(TAG, "User access revoked!"); mGoogleApiClient.connect(); updateUI(false); } });} – rahul Nov 06 '14 at 13:59
  • did you managed to find a solution??revoke is not working – kgandroid Dec 12 '14 at 06:41
  • No I am still facing this issue. I left this to resolve at the end of my application – rahul Dec 12 '14 at 09:00
  • Whenever I find I will post it here – rahul Dec 12 '14 at 09:01
  • did find the solution??plzz post here – madhu527 Mar 27 '15 at 09:51
  • I did it but its not a proper solution. What I did is I setup google plus same as I setup for login and the revoked the access and it worked for me. – rahul Apr 08 '15 at 15:10
  • Check http://stackoverflow.com/questions/31734567/separating-the-concerns-of-activity-and-googleapiclient/31734568#31734568 – JP Ventura Jul 30 '15 at 21:51

0 Answers0