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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -