This page refers to a deprecated version of Google Sign-In. New projects should use the current version.

Revoking Access Tokens and Disconnecting the App

It is highly recommended that you provide users that signed in with Google the ability to disconnect their Google account from your app. If the user deletes their account, you must delete the information that your app obtained from the Google APIs.

The following code shows a simple example of calling the GoogleApiClient.revokeAccessAndDisconnect method:

@Override
public void onClick(View view) {
    // ...
    if (view.getId() == R.id.disconnect_button) {
        onDisconnectClicked();
    }
}
private void onDisconnectClicked() {
    // Revoke all granted permissions and clear the default account.  The user will have
    // to pass the consent screen to sign in again.
    if (mGoogleApiClient.isConnected()) {
        Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);
        Plus.AccountApi.revokeAccessAndDisconnect(mGoogleApiClient);
        mGoogleApiClient.disconnect();
    }

    showSignedOutUI();
}

In the onResult callback, you can respond to the event and trigger any appropriate logic in your app or your back-end code.