A library we are using, Usabilla: https://github.com/usabilla/usabilla-u4a-android-sdk/issues/180#
presents a banner fragment at any point in the app, when a certain event occurs.
The only method that we call to trigger the event, is this: Usabilla.sendEvent(applicationContext,eventString)
It works fine when the activity layout has no fragment tag. But when we include a NavHostFragment in the layout, the app crashes because logger says that the view is null for (android:id/content). Any ideas what we could do to fix the issue (so that even with a NavHostFragment, the android:id/content will still be found)?
Stack trace:
2020-10-29 06:00:05.796 22184-22184/au.com.nib.memberapp.develop E/AndroidRuntime: FATAL EXCEPTION: main Process: au.com.nib.memberapp.develop, PID: 22184 java.lang.IllegalArgumentException: No view found for id 0x1020002 (android:id/content) for fragment BannerFragment{32c54c0} (c7b3bbc0-668a-4553-9c52-f031b04f8a83) id=0x1020002} at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:315) at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1199) at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1368) at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1446) at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1509) at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:447) at androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:2181) at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2004) at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1959) at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1861) at androidx.fragment.app.FragmentManager$4.run(FragmentManager.java:413) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:237) at android.app.ActivityThread.main(ActivityThread.java:8167) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)