I need to handle when a user "clicks" (taps) on the background of a GridView (ie. outside of an item).
When I add an onClickListener to the GridView I get the following error:
Caused by java.lang.RuntimeException: Don't call setOnClickListener for an AdapterView. You probably want setOnItemClickListener instead
at android.widget.AdapterView.setOnClickListener(AdapterView.java:777)
It seems the parent AdapterView overrides the setOnCLickListener and just throws an error.
I have tried adding an onClickListener to the parent view of the grid view, but it is never called when you tap on the background of the GridView.
How is it possible to implement this functionality?
All the stackoverflow questions I have seen seem to be for people who actually need to to call setOnItemClickListener, but this is not the case for me. The OnItemClickListener is not called in this case.