An easy/stupid way:
-
Create a dummy empty view (let’s say ImageView with no source), make it fill parent
-
If it is clicked, then do what you want to do.
You need to have the root tag in your XML file to be a RelativeLayout. It will contain two element: your dummy view (set its position to align the Parent Top
). The other one is your original view containing the views and the button (this view might be a LinearLayout or whatever you make it. don’t forget to set its position to align the Parent Top
)
Hope this will help you, Good Luck !