fix(android): failure saving state in mixed parent/nested frame nav (#6719)

This commit is contained in:
Manol Donev
2018-12-18 10:23:02 +02:00
committed by SvetoslavTsenov
parent 54b6df669b
commit e5f110fe5c

View File

@@ -903,6 +903,12 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks {
return null; return null;
} }
// [nested frames / fragments] see https://github.com/NativeScript/NativeScript/issues/6629
// retaining reference to a destroyed fragment here somehow causes a cryptic
// "IllegalStateException: Failure saving state: active fragment has cleared index: -1"
// in a specific mixed parent / nested frame navigation scenario
entry.fragment = null;
const page = entry.resolvedPage; const page = entry.resolvedPage;
if (!page) { if (!page) {
traceError(`${fragment}.onDestroy: entry has no resolvedPage`); traceError(`${fragment}.onDestroy: entry has no resolvedPage`);