android - How to pass custom layout listviews onitemclick event to its parent activity? -
my activity loads listview customlistlayout.java (baseadapter
) file, have written custom list , click event, using customadapter.java class.
also in activity have ontouchlistener (onclicklistener)
, want pass onitemclick
event parent activity.
i tried writing ontouch
, onclick
events on customlist , returned false, event not passed main activity.
how can achieve ?
if using seperate class adapter, try passing handler constructor of adapter class , use send message parent activity.
public customadapter(context context, handler h) { this.handler = h; }
later can use handler pass events parent activity.
Comments
Post a Comment