diff --git a/android/src/main/java/com/reactnativenavigation/customrow/BottomTabsCustomRowAttacher.kt b/android/src/main/java/com/reactnativenavigation/customrow/BottomTabsCustomRowAttacher.kt index 064b854cf6..0efcb47aa3 100644 --- a/android/src/main/java/com/reactnativenavigation/customrow/BottomTabsCustomRowAttacher.kt +++ b/android/src/main/java/com/reactnativenavigation/customrow/BottomTabsCustomRowAttacher.kt @@ -90,10 +90,10 @@ internal object BottomTabsCustomRowAttacher : Application.ActivityLifecycleCallb } private fun tryAttach(activity: Activity) { - val scanRoot = activity.window?.decorView as? ViewGroup - ?: activity.findViewById(android.R.id.content) as? ViewGroup - ?: return - val overlayHost = activity.findViewById(android.R.id.content) as? ViewGroup + val scanRoot = activity.window?.decorView as? ViewGroup ?: return + // Resolve through the view tree: AppCompatActivity.findViewById() forces + // createSubDecor(), which throws unless the activity's theme is Theme.AppCompat. + val overlayHost = scanRoot.findViewById(android.R.id.content) as? ViewGroup ?: scanRoot forEachBottomTabs(scanRoot) { bottomTabs ->