Skip to content

Commit

Permalink
Fixes #1555
Browse files Browse the repository at this point in the history
  • Loading branch information
VishnuSanal committed Sep 6, 2021
1 parent 75c3965 commit cff4c8b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit cff4c8b

Please sign in to comment.