diff options
author | stefan-niedermann <info@niedermann.it> | 2019-02-10 23:06:49 +0300 |
---|---|---|
committer | stefan-niedermann <info@niedermann.it> | 2019-02-10 23:18:19 +0300 |
commit | ec3ccba3dbb6b79b15f98d37a62224c1a5cad71b (patch) | |
tree | 4a89e3630e74263a58a0ba8188f93a807b12eae7 /app/src/main | |
parent | 99d3224a3b791f6538cd36a121e6b4a7c14b1d68 (diff) |
#529 Switching theme must recreate MainActivity
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java index ccdfbec8..d7181ca2 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java @@ -582,15 +582,9 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap } listView.scrollToPosition(0); } else if (requestCode == server_settings) { - // Create new Instance with new URL and credentials - db = NoteSQLiteOpenHelper.getInstance(this); - if (db.getNoteServerSyncHelper().isSyncPossible()) { - this.updateUsernameInDrawer(); - adapter.removeAll(); - synchronize(); - } else { - Toast.makeText(getApplicationContext(), getString(R.string.error_sync, getString(NotesClientUtil.LoginStatus.NO_NETWORK.str)), Toast.LENGTH_LONG).show(); - } + // Recreate activity completely, because theme switchting makes problems when only invalidating the views. + // @see https://github.com/stefan-niedermann/nextcloud-notes/issues/529 + recreate(); } } |