Skip to content
This repository has been archived by the owner. It is now read-only.

Commit b5cd127

Browse files
authored
Merge pull request #290 from thefex/backstack_flag_not_respected_if_cache_is_empty_issuefix
Issue #289 back stack fix
2 parents 8e045d4 + 48bc1c1 commit b5cd127

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

MvvmCross.Droid.Support.V4/MvxCachingFragmentActivity.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ protected virtual void ShowFragment(string tag, int contentId, Bundle bundle, bo
258258
//Otherwise, create one and cache it
259259
fragInfo.CachedFragment = Fragment.Instantiate(this, FragmentJavaName(fragInfo.FragmentType),
260260
bundle) as IMvxFragmentView;
261+
currentFragment = fragInfo.CachedFragment as Fragment;
261262
OnFragmentCreated(fragInfo, ft);
262263
}
263264

MvvmCross.Droid.Support.V7.AppCompat/MvxCachingFragmentCompatActivity.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ protected virtual void ShowFragment(string tag, int contentId, Bundle bundle, bo
216216
//Otherwise, create one and cache it
217217
fragInfo.CachedFragment = Fragment.Instantiate(this, FragmentJavaName(fragInfo.FragmentType),
218218
bundle) as IMvxFragmentView;
219-
OnFragmentCreated(fragInfo, ft);
219+
currentFragment = fragInfo.CachedFragment as Fragment;
220+
OnFragmentCreated(fragInfo, ft);
220221
}
221222

222223
ft.Replace(fragInfo.ContentId, fragInfo.CachedFragment as Fragment, fragInfo.Tag);

0 commit comments

Comments
 (0)