Skip to content

Commit

Permalink
[WIP] fixes #1555
Browse files Browse the repository at this point in the history
  • Loading branch information
VishnuSanal committed Jun 9, 2024
1 parent 7c65a62 commit 0e7911b
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,15 @@ public void onSaveInstanceState(@NonNull Bundle outState) {
sharedPrefs.edit().putInt(PREFERENCE_CURRENT_TAB, MainActivity.currentTab).apply();
}

if (fragments.size() != 0) {
if (fragmentManager == null) {
return;
}
if (fragmentManager != null
&& !fragments.isEmpty()
&& fragments.get(0).isAdded()
&& fragments.get(1).isAdded()) {

fragmentManager.executePendingTransactions();
fragmentManager.putFragment(outState, KEY_FRAGMENT_0, fragments.get(0));
fragmentManager.putFragment(outState, KEY_FRAGMENT_1, fragments.get(1));

outState.putInt(KEY_POSITION, viewPager.getCurrentItem());
}
super.onSaveInstanceState(outState);
Expand Down

0 comments on commit 0e7911b

Please sign in to comment.