<BlockSwitcher>
<Block name="Java">

```java
Amplify.Auth.signOut( signOutResult -> {
    if (signOutResult instanceof AWSCognitoAuthSignOutResult.CompleteSignOut) {
        // Sign Out completed fully and without errors.
        Log.i("AuthQuickStart", "Signed out successfully");
    } else if (signOutResult instanceof AWSCognitoAuthSignOutResult.PartialSignOut) {
        // Sign Out completed with some errors. User is signed out of the device.
        AWSCognitoAuthSignOutResult.PartialSignOut partialSignOutResult =
                (AWSCognitoAuthSignOutResult.PartialSignOut) signOutResult;

        HostedUIError hostedUIError = partialSignOutResult.getHostedUIError();
        if (hostedUIError != null) {
            Log.e("AuthQuickStart", "HostedUI Error", hostedUIError.getException());
            // Optional: Re-launch hostedUIError.getUrl() in a Custom tab to clear Cognito web session.
        }

        GlobalSignOutError globalSignOutError = partialSignOutResult.getGlobalSignOutError();
        if (globalSignOutError != null) {
            Log.e("AuthQuickStart", "GlobalSignOut Error", globalSignOutError.getException());
            // Optional: Use escape hatch to retry revocation of globalSignOutError.getAccessToken().
        }

        RevokeTokenError revokeTokenError = partialSignOutResult.getRevokeTokenError();
        if (revokeTokenError != null) {
            Log.e("AuthQuickStart", "RevokeToken Error", revokeTokenError.getException());
            // Optional: Use escape hatch to retry revocation of revokeTokenError.getRefreshToken().
        }
    } else if (signOutResult instanceof AWSCognitoAuthSignOutResult.FailedSignOut) {
        AWSCognitoAuthSignOutResult.FailedSignOut failedSignOutResult =
                (AWSCognitoAuthSignOutResult.FailedSignOut) signOutResult;
        // Sign Out failed with an exception, leaving the user signed in.
        Log.e("AuthQuickStart", "Sign out Failed", failedSignOutResult.getException());
    }
});
```

</Block>
<Block name="Kotlin - Callbacks">

```kotlin
Amplify.Auth.signOut { signOutResult ->
    when(signOutResult) {
        is AWSCognitoAuthSignOutResult.CompleteSignOut -> {
            // Sign Out completed fully and without errors.
            Log.i("AuthQuickStart", "Signed out successfully")
        }
        is AWSCognitoAuthSignOutResult.PartialSignOut -> {
            // Sign Out completed with some errors. User is signed out of the device.
            signOutResult.hostedUIError?.let {
                Log.e("AuthQuickStart", "HostedUI Error", it.exception)
                // Optional: Re-launch it.url in a Custom tab to clear Cognito web session.

            }
            signOutResult.globalSignOutError?.let {
                Log.e("AuthQuickStart", "GlobalSignOut Error", it.exception)
                // Optional: Use escape hatch to retry revocation of it.accessToken.
            }
            signOutResult.revokeTokenError?.let {
                Log.e("AuthQuickStart", "RevokeToken Error", it.exception)
                // Optional: Use escape hatch to retry revocation of it.refreshToken.
            }
        }
        is AWSCognitoAuthSignOutResult.FailedSignOut -> {
            // Sign Out failed with an exception, leaving the user signed in.
            Log.e("AuthQuickStart", "Sign out Failed", signOutResult.exception)
        }
    }
}
```

</Block>
<Block name="Kotlin - Coroutines">

```kotlin
val signOutResult = Amplify.Auth.signOut()
when(signOutResult) {
    is AWSCognitoAuthSignOutResult.CompleteSignOut -> {
        // Sign Out completed fully and without errors.
        Log.i("AuthQuickStart", "Signed out successfully")
    }
    is AWSCognitoAuthSignOutResult.PartialSignOut -> {
        // Sign Out completed with some errors. User is signed out of the device.
        signOutResult.hostedUIError?.let {
            Log.e("AuthQuickStart", "HostedUI Error", it.exception)
            // Optional: Re-launch it.url in a Custom tab to clear Cognito web session.

        }
        signOutResult.globalSignOutError?.let {
            Log.e("AuthQuickStart", "GlobalSignOut Error", it.exception)
            // Optional: Use escape hatch to retry revocation of it.accessToken.
        }
        signOutResult.revokeTokenError?.let {
            Log.e("AuthQuickStart", "RevokeToken Error", it.exception)
            // Optional: Use escape hatch to retry revocation of it.refreshToken.
        }
    }
    is AWSCognitoAuthSignOutResult.FailedSignOut -> {
        // Sign Out failed with an exception, leaving the user signed in.
        Log.e("AuthQuickStart", "Sign out Failed", signOutResult.exception)
    }
}
```

</Block>
<Block name="RxJava">

```java
RxAmplify.Auth.signOut()
    .subscribe(signOutResult -> {
        if (signOutResult instanceof AWSCognitoAuthSignOutResult.CompleteSignOut) {
            // Sign Out completed fully and without errors.
            Log.i("AuthQuickStart", "Signed out successfully");
        } else if (signOutResult instanceof AWSCognitoAuthSignOutResult.PartialSignOut) {
            // Sign Out completed with some errors. User is signed out of the device.
            AWSCognitoAuthSignOutResult.PartialSignOut partialSignOutResult =
                    (AWSCognitoAuthSignOutResult.PartialSignOut) signOutResult;

            HostedUIError hostedUIError = partialSignOutResult.getHostedUIError();
            if (hostedUIError != null) {
                Log.e("AuthQuickStart", "HostedUI Error", hostedUIError.getException());
                // Optional: Re-launch hostedUIError.getUrl() in a Custom tab to clear Cognito web session.
            }

            GlobalSignOutError globalSignOutError = partialSignOutResult.getGlobalSignOutError();
            if (globalSignOutError != null) {
                Log.e("AuthQuickStart", "GlobalSignOut Error", globalSignOutError.getException());
                // Optional: Use escape hatch to retry revocation of globalSignOutError.getAccessToken().
            }

            RevokeTokenError revokeTokenError = partialSignOutResult.getRevokeTokenError();
            if (revokeTokenError != null) {
                Log.e("AuthQuickStart", "RevokeToken Error", revokeTokenError.getException());
                // Optional: Use escape hatch to retry revocation of revokeTokenError.getRefreshToken().
            }
        } else if (signOutResult instanceof AWSCognitoAuthSignOutResult.FailedSignOut) {
            AWSCognitoAuthSignOutResult.FailedSignOut failedSignOutResult =
                    (AWSCognitoAuthSignOutResult.FailedSignOut) signOutResult;
            // Sign Out failed with an exception, leaving the user signed in.
            Log.e("AuthQuickStart", "Sign out Failed", failedSignOutResult.getException());
        }
    });
```

</Block>
</BlockSwitcher>
