From bc2cef963080afefd1b0c8f4e5c74fa6f4b5ce69 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 11 Jun 2015 08:32:27 +0300 Subject: [PATCH] restart when cats get enabled/disabled --- .../src/main/java/org/fox/ttrss/MasterActivity.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/MasterActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/MasterActivity.java index 0df1c48f..2c3abf1a 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/MasterActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/MasterActivity.java @@ -40,6 +40,7 @@ public class MasterActivity extends OnlineActivity implements HeadlinesEventList private boolean m_feedIsSelected = false; private boolean m_userFeedSelected = false; + private boolean m_catsEnabled = false; private ActionBarDrawerToggle m_drawerToggle; private DrawerLayout m_drawerLayout; @@ -61,6 +62,8 @@ public class MasterActivity extends OnlineActivity implements HeadlinesEventList Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); + m_catsEnabled = m_prefs.getBoolean("enable_cats", false); + Application.getInstance().load(savedInstanceState); m_drawerLayout = (DrawerLayout) findViewById(R.id.headlines_drawer); @@ -409,6 +412,14 @@ public class MasterActivity extends OnlineActivity implements HeadlinesEventList public void onResume() { super.onResume(); invalidateOptionsMenu(); + + if (!m_catsEnabled == m_prefs.getBoolean("enable_cats", false)) { + Log.d(TAG, "root view settings changed, restarting"); + + finish(); + startActivity(getIntent()); + } + } @Override