From cff4c8bef4c15d7959594fc7d7eb80a8d0bc3e10 Mon Sep 17 00:00:00 2001 From: "Vishnu Sanal. T" Date: Mon, 6 Sep 2021 10:46:12 +0530 Subject: [PATCH] Fixes #1555 --- .../com/amaze/filemanager/ui/fragments/TabFragment.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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());