Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added logout method #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions app/src/main/java/com/github/mobile/accounts/LoginActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ protected List<User> run(Account account) throws Exception {
return cache.getOrgs(true);
}
}
private boolean isLoggingOut;

private AccountManager accountManager;

Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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();
}

/**
Expand Down