| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -755,6 +755,17 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks { | |||
| 755 | 755 | if (traceEnabled()) { | |
| 756 | 756 | traceWrite(`${fragment}.onDestroyView()`, traceCategories.NativeLifecycle); | |
| 757 | 757 | } | |
| 758 | + | ||
| 759 | + // fixes 'java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first'. | ||
| 760 | + // on app resume in nested frame scenarios with support library version greater than 26.0.0 | ||
| 761 | + const view = fragment.getView(); | ||
| 762 | + if (view != null) { | ||
| 763 | + const viewParent = view.getParent(); | ||
| 764 | + if (viewParent instanceof android.view.ViewGroup) { | ||
| 765 | + viewParent.removeView(view); | ||
| 766 | + } | ||
| 767 | + } | ||
| 768 | + | ||
| 758 | 769 | superFunc.call(fragment); | |
| 759 | 770 | } | |
| 760 | 771 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments