Stay organized with collections
Save and categorize content based on your preferences.
You can enable your users to sign out of your app, and to disconnect their
accounts from your app entirely.
Sign out users
To add a sign out button to your app, first create a button in your app to act
as your sign out button. Then, attach an
onClickListener
to the button and configure the onClick method to call
signOut.
This code clears which account is connected to the app. To sign in again, the
user must choose their account again.
Disconnect accounts
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
revokeAccess
method:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eGoogle Sign-In for Android is outdated and developers should migrate to Credential Manager for enhanced security and user experience, except for Wear OS 3, 4, and 5.0 which need to continue using Google Sign-In for Android.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can implement sign-out functionality in their apps, requiring users to re-select their account for subsequent sign-ins.\u003c/p\u003e\n"],["\u003cp\u003eIt is crucial for developers to allow users to disconnect their Google accounts from the app, and delete user data if the user deletes their Google account.\u003c/p\u003e\n"]]],[],null,["# Signing Out Users and Disconnecting Accounts\n\n| **Warning:** Google Sign-In for Android is outdated and no longer supported. To ensure the continued security and usability of your app, [migrate\n| to Credential Manager](https://developer.android.com/training/sign-in/credential-manager/) today. Credential Manager supports passkey, password, and federated identity authentication (such as Sign-in with Google), stronger security, and a more consistent user experience. For Wear developers: Credential Manager will be supported in Wear OS 5.1 and later on selected watches. Developers actively supporting Wear OS 3, 4 and 5.0 devices with Sign in with Google should continue using Google Sign-in for Android for your Wear applications. Sign in with Google support will be available on Credential Manager APIs for these versions of WearOS at a later date.\n\nYou can enable your users to sign out of your app, and to disconnect their\naccounts from your app entirely.\n\nSign out users\n--------------\n\nTo add a sign out button to your app, first create a button in your app to act\nas your sign out button. Then, attach an\n[`onClickListener`](https://developer.android.com/reference/android/view/View.OnClickListener.html)\nto the button and configure the `onClick` method to call\n[`signOut`](/android/reference/com/google/android/gms/auth/api/signin/GoogleSignInClient#signOut()). \n\n @Override\n public void onClick(View v) {\n switch (v.getId()) {\n // ...\n case R.id.button_sign_out:\n signOut();\n break;\n // ...\n }\n }\n\n```transact-sql\nprivate void signOut() {\n mGoogleSignInClient.signOut()\n .addOnCompleteListener(this, new OnCompleteListener\u003cVoid\u003e() {\n @Override\n public void onComplete(@NonNull Task\u003cVoid\u003e task) {\n // ...\n }\n });\n}\n```\n\nThis code clears which account is connected to the app. To sign in again, the\nuser must choose their account again.\n\nDisconnect accounts\n-------------------\n\nIt is highly recommended that you provide users that signed in with Google the\nability to disconnect their Google account from your app. If the user deletes\ntheir account, you must delete the information that your app obtained from the\nGoogle APIs.\n\nThe following code shows a simple example of calling the\n[`revokeAccess`](/android/reference/com/google/android/gms/auth/api/signin/GoogleSignInClient#revokeAccess())\nmethod: \n\n```transact-sql\nprivate void revokeAccess() {\n mGoogleSignInClient.revokeAccess()\n .addOnCompleteListener(this, new OnCompleteListener\u003cVoid\u003e() {\n @Override\n public void onComplete(@NonNull Task\u003cVoid\u003e task) {\n // ...\n }\n });\n}\n```\n\nIn the completion listener, you can respond to the event and trigger any\nappropriate logic in your app or your back-end code."]]