Skip to content

Commit

Permalink
- make sure we can find the fragment in the stack before we set it
Browse files Browse the repository at this point in the history
  • Loading branch information
ncapdevi committed Nov 16, 2017
1 parent 001e161 commit f934f81
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -608,9 +608,13 @@ public Fragment getCurrentFrag() {
//if not, try to pull it from the stack
Stack<Fragment> fragmentStack = mFragmentStacks.get(mSelectedTabIndex);
if (!fragmentStack.isEmpty()) {
mCurrentFrag = mFragmentManager.findFragmentByTag(mFragmentStacks.get(mSelectedTabIndex).peek().getTag());
Fragment fragmentByTag = mFragmentManager.findFragmentByTag(mFragmentStacks.get(mSelectedTabIndex).peek().getTag());
if (fragmentByTag != null) {
mCurrentFrag = fragmentByTag;
}
}


return mCurrentFrag;
}

Expand Down

0 comments on commit f934f81

Please sign in to comment.