From 641ab254703cee451eb136f05513e6a8c4c82610 Mon Sep 17 00:00:00 2001 From: Mauricio Colli Date: Sun, 14 May 2017 11:10:00 -0300 Subject: [PATCH] Fix Settings on screen rotation --- .../org/schabi/newpipe/settings/SettingsActivity.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/settings/SettingsActivity.java b/app/src/main/java/org/schabi/newpipe/settings/SettingsActivity.java index a1e8fb49b..f076c5645 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/SettingsActivity.java +++ b/app/src/main/java/org/schabi/newpipe/settings/SettingsActivity.java @@ -53,15 +53,17 @@ public class SettingsActivity extends AppCompatActivity { actionBar.setDisplayShowTitleEnabled(true); } - getFragmentManager().beginTransaction() - .replace(R.id.fragment_holder, new SettingsFragment()) - .commit(); + if (savedInstanceBundle == null) { + getFragmentManager().beginTransaction() + .replace(R.id.fragment_holder, new SettingsFragment()) + .commit(); + } } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); - if(id == android.R.id.home) { + if (id == android.R.id.home) { finish(); } return true;