Why am I able to click "behind" the bottomsheet in Android?
I faced same issue !
Add android:clickable=true
to your BottomSheet ! Should look like below !
<LinearLayout
android:clickable="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/materialWhite"
android:orientation="vertical"
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
</LinearLayout>
A simple solution is to add the
android:clickable="true"
attribute to the layout that you are using for your bottom sheet. That way it will capture all clicks, and not let them bleed through. You do not have to set an onClick
method for it, as you have no need to handle them.