Skip to content Skip to sidebar Skip to footer

Dynamically RelativeLayout And Clickable

I try to create listView dynamically from code with: @Override public View getView(int position, View convertView, ViewGroup parent) { View v = convertView; ViewHolder hold

Solution 1:

you can add your click listener to your v view returned within the getView() method

v.setOnClickListener(new OnClickListener(){
    public void onClick(View v) {
     }....

this should work - works for me. the methods called within should be moved elsewhere. not sure if you want to implement the View.OnClickListener in the Adapter but it's up to you i guess.

Cheers


Post a Comment for "Dynamically RelativeLayout And Clickable"