diff --git a/app/src/main/java/com/amaze/filemanager/ui/fragments/TabFragment.java b/app/src/main/java/com/amaze/filemanager/ui/fragments/TabFragment.java index 3b324b1596..fb8c5ba613 100644 --- a/app/src/main/java/com/amaze/filemanager/ui/fragments/TabFragment.java +++ b/app/src/main/java/com/amaze/filemanager/ui/fragments/TabFragment.java @@ -240,7 +240,11 @@ public void onSaveInstanceState(Bundle outState) { if (fragments != null && fragments.size() != 0) { if (fragmentManager == null) return; for (Fragment fragment : fragments) { - fragmentManager.putFragment(outState, "tab" + i, fragment); + + if (fragment.isAdded()) { + fragmentManager.putFragment(outState, "tab" + i, fragment); + } + i++; } outState.putInt(KEY_POSITION, mViewPager.getCurrentItem());