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