From d0fd46c21d676f201b9018725a0c067e5df3f6cc Mon Sep 17 00:00:00 2001 From: nuclearfog Date: Thu, 26 Dec 2019 12:02:05 +0100 Subject: [PATCH] logout bug fix --- .../java/org/nuclearfog/twidda/activity/AppSettings.java | 2 +- .../java/org/nuclearfog/twidda/database/GlobalSettings.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/nuclearfog/twidda/activity/AppSettings.java b/app/src/main/java/org/nuclearfog/twidda/activity/AppSettings.java index 1b23f91c..73226a00 100644 --- a/app/src/main/java/org/nuclearfog/twidda/activity/AppSettings.java +++ b/app/src/main/java/org/nuclearfog/twidda/activity/AppSettings.java @@ -210,7 +210,7 @@ public class AppSettings extends AppCompatActivity implements OnClickListener, .setPositiveButton(R.string.yes_confirm, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - settings.logout(); + settings.logout(getApplicationContext()); TwitterEngine.destroyInstance(); DatabaseAdapter.deleteDatabase(getApplicationContext()); setResult(APP_LOGOUT); diff --git a/app/src/main/java/org/nuclearfog/twidda/database/GlobalSettings.java b/app/src/main/java/org/nuclearfog/twidda/database/GlobalSettings.java index 094682ef..d36f9b53 100644 --- a/app/src/main/java/org/nuclearfog/twidda/database/GlobalSettings.java +++ b/app/src/main/java/org/nuclearfog/twidda/database/GlobalSettings.java @@ -411,8 +411,9 @@ public class GlobalSettings { /** * Remove all user content from Shared Preferences */ - public void logout() { + public void logout(Context c) { settings.edit().clear().apply(); - ourInstance = null; + loggedIn = false; + ourInstance = new GlobalSettings(c); } } \ No newline at end of file