My app had a very strange problem of BottomNavigationView of automatically opens and closes within a second. I have already fixed the issue today. I will explain my finding here. It will help someone. I have a bnv in activity and that activity had a fragment. I have tried to use
android:windowSoftInputMode="adjustPan|adjustResize"
It didn't fixed the issue for me. When i tried
android:windowSoftInputMode="adjustNothing"
There was a different behavior. The bottom sheet would open and not close automatically. I would have to manually close it.
In my frament i call a Api to fetch data and create recyclerview at runtime in kotlin. by default i would set nestedScrolling to true
bindingShows.rv.isNestedScrollingEnabled = true
Then I changed it to false. Then, the behavior changed unexpectedly. The bottomsheet would not auto open. I thought i fixed the issue. But when I tap anywhere inside the fragment the bottom sheet would open again. I was like wth? What is causing the problem? Then,by the stroke of luck I actually managed to fixed the issue. But changing the view to FrameLayout from linearLayout in Activity.
I was using LinearLayout, I just change it to FrameLayout. It fixed the issue for me
In Manifest