| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e685d2e commit f2f9d81
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -775,6 +775,17 @@ class FragmentCallbacksImplementation implements AndroidFragmentCallbacks { | |||
| 775 | 775 | if (traceEnabled()) { | |
| 776 | 776 | traceWrite(`${fragment}.onDestroyView()`, traceCategories.NativeLifecycle); | |
| 777 | 777 | } | |
| 778 | + | ||
| 779 | + // fixes 'java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first'. | ||
| 780 | + // on app resume in nested frame scenarios with support library version greater than 26.0.0 | ||
| 781 | + const view = fragment.getView(); | ||
| 782 | + if (view != null) { | ||
| 783 | + const viewParent = view.getParent(); | ||
| 784 | + if (viewParent instanceof android.view.ViewGroup) { | ||
| 785 | + viewParent.removeView(view); | ||
| 786 | + } | ||
| 787 | + } | ||
| 788 | + | ||
| 778 | 789 | superFunc.call(fragment); | |
| 779 | 790 | } | |
| 780 | 791 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments