How to log out a google account from an Android app

233 views Asked by At

I am working on an Android app which uses google authentication. I have this code segment:

try {
    String token = GoogleAuthUtil.getToken(main, id, "oauth2:profile");
    TRC.debug("google token=" + token);
    return token;
} catch (UserRecoverableAuthException e) {
    main.startActivityForResult(e.getIntent(), 15); // TODO const for 15

I would like to test the catch branch. When I've tried it first I got the google authentication Activity displayed. But when I tried it next time the UserRecoverableAuthException hadn't thrown.

How is it possible to force the app to log out from google?

0

There are 0 answers