logout bug fix

This commit is contained in:
nuclearfog 2019-12-26 12:02:05 +01:00
parent bef82da590
commit d0fd46c21d
No known key found for this signature in database
GPG Key ID: ED35E22099354A64
2 changed files with 4 additions and 3 deletions

View File

@ -210,7 +210,7 @@ public class AppSettings extends AppCompatActivity implements OnClickListener,
.setPositiveButton(R.string.yes_confirm, new DialogInterface.OnClickListener() { .setPositiveButton(R.string.yes_confirm, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
settings.logout(); settings.logout(getApplicationContext());
TwitterEngine.destroyInstance(); TwitterEngine.destroyInstance();
DatabaseAdapter.deleteDatabase(getApplicationContext()); DatabaseAdapter.deleteDatabase(getApplicationContext());
setResult(APP_LOGOUT); setResult(APP_LOGOUT);

View File

@ -411,8 +411,9 @@ public class GlobalSettings {
/** /**
* Remove all user content from Shared Preferences * Remove all user content from Shared Preferences
*/ */
public void logout() { public void logout(Context c) {
settings.edit().clear().apply(); settings.edit().clear().apply();
ourInstance = null; loggedIn = false;
ourInstance = new GlobalSettings(c);
} }
} }