diff --git a/app/src/main/java/com/github/mobile/accounts/LoginActivity.java b/app/src/main/java/com/github/mobile/accounts/LoginActivity.java index cff4b0bcb..7084aabd4 100644 --- a/app/src/main/java/com/github/mobile/accounts/LoginActivity.java +++ b/app/src/main/java/com/github/mobile/accounts/LoginActivity.java @@ -129,6 +129,7 @@ protected List run(Account account) throws Exception { return cache.getOrgs(true); } } + private boolean isLoggingOut; private AccountManager accountManager; @@ -284,6 +285,30 @@ public void startActivity(Intent intent) { super.startActivity(intent); } + public static class LogOut { + private static LogOut logOut; + + private boolean isLoggingOut; + + private LogOut() { + } + + public static LogOut getLogOut() { + if (logOut == null) { + logOut = new LogOut(); + } + return logOut; + } + + public boolean isLoggingOut() { + return isLoggingOut; + } + + public void setLoggingOut(boolean isLoggingOut) { + this.isLoggingOut = isLoggingOut; + } + } + /** * Authenticate login & password */ @@ -391,6 +416,10 @@ protected void finishConfirmCredentials(boolean result) { setAccountAuthenticatorResult(intent.getExtras()); setResult(RESULT_OK, intent); finish(); + + Intent logOutIntent = new Intent(this, LoginActivity.class); + startActivity(intent); + finish(); } /**