Sat Siva Sat Siva - 9 months ago 44
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$OnConnectionFailedListener

Answer Source

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..

public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {


thats it..

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