If you are using an fragment over an activity that is set to full screen ie match_parent
. Then in the fragments root layout you can set an attribute android:clickable="true"
to consume click events. By default layouts such as RelativeLayout , LinearLayout etc don't consume click events. Other views such as Button and TextView have this on by default.
In your overlay fragment.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true">
</RelativeLayout>