android - Can a Gridview have both an onclick and onitemclick listener? -


I have a gridview for employing an image adapter. At present, a person can click and long click each individual image in Gridview. I am trying to add functionality so that anyone can click on the gridview, which is to say that there is no space filled with image adapters. This is my endeavor like this:

  mGridViewWords.SsetAdapter (new AACButtonAdapter (this, button_size, TouchButtonAdapter.TOPIC_WORDS, MDB)); MGridViewWords.SsetOnItemClickListener (New OnTimeClicklist) {ITEMClick on Public Zero (adapterview & lt ;? & gt; parent, v, int position, long id) {AddWordButtonAction (TouchButton) v)}}); MGridViewWords.SsetOnClickListener (New SelectViewListener ()); MGridViewWords.setOnItemLongClickListener {New BooleanOnLogClickListener} {Public Boolean ON ITEM LongClick (adapterview  .setOnClickListener () , I get this error in the logcate:  

Java.lang Runtime Exposure: Do not call set-clickclicks for an adapter view. You might want to set up instead of setOntemeClickList

Is anyone's advice that I should say about different ways of getting the functionality after that? Can there be two adapters set for Gridview?

Assuming your gridwoo takes the whole screen, there is a solution in a frame layout under it And keep the scene that fills the entire screen (for example, an image view with no image: source specified). If the user clicks on an area not occupied on a grid item, the touch event will cross the built-in view, where you can process it as a click in the desired grid view, only slightly, but Your situation is not normal.

Comments