Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tns-core-modules/ui/frame/frame.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,17 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks {
if (traceEnabled()) {
traceWrite(`${fragment}.onDestroyView()`, traceCategories.NativeLifecycle);
}

// fixes 'java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first'.
// on app resume in nested frame scenarios with support library version greater than 26.0.0
const view = fragment.getView();
if (view != null) {
const viewParent = view.getParent();
if (viewParent instanceof android.view.ViewGroup) {
viewParent.removeView(view);
}
}

superFunc.call(fragment);
}

Expand Down