Sat Siva Sat Siva - 21 days ago 9
Android Question

How can i logout from google account when i click my logout button in my android project

i tried this code in to my project the compiler will show the following error.

this is my code.

Auth.GoogleSignInApi.signOut(mGoogleApiClient).setResultCallback(new ResultCallback<Status>() { @Override public void onResult(Status status) { } });


and this is my error

cannot be cast to com.google.android.gms.common.api.GoogleApiClient$OnConnectionFailedListener

Answer

i can understand your problem ...

i think you did not implement GoogleApiClient.OnConnectionFailedListener this listener .. and to include this following function in to your java file like..

@Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {

}

thats it..

if you want more information see this following link enter link description here