Not entering into onClick() or onLongPress() of GridView + android -


  • i have gridview.
  • i setting adapter it.
  • adding setonclicklistener() , setonlongclicklistener().

issue :

  • sometimes enters setonlongclicklistener()
  • sometimes in setonclicklistener() ,
  • sometimes in none.

public class abcadapter extends baseadapter {

...  @override public view getview(int position, view convertview, viewgroup arg2) { viewholder holder = null;     final answer option = moptionslist.get(position);     if (convertview == null) {         holder = new viewholder();         convertview = minflater.inflate(mlayoutid, null);         holder.data = (textview) convertview.findviewbyid(r.id.data);         holder.row = (linearlayout) convertview                 .findviewbyid(r.id.row);         convertview.settag(holder);     } else {         holder = (optionviewholder) convertview.gettag();     }     holder.data.settext("data");     holder.row.setonclicklistener(new view.onclicklistener() {     @override         public void onclick(final view selectionview) {         ...         }     });     holder.row.setonlongclicklistener(new view.onlongclicklistener() {     @override         public boolean onlongclick(view view) {         ...         return false;         }     }); } 

...

}

try gridview.setonitemclicklistener(new onitemclicklistener()

from activity has gridview


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -