views:

54

answers:

1
+1  Q: 

button in listView

hi, I have Button and TextView in my ListView , and I would add listener on button but I can't do it.

Actually I have in my adapter :

[code]

        imgClassement.setImageResource(drawable);
        imgClassement.setTag(mail);
        imgClassement.setOnClickListener(new OnClickListener(){

         @Override
         public void onClick(View view){

          //I would like display an alerts in my activity

         }


        });

[/code]

The OnClick works but, I would like to display alerts on my activity and I can't do it :/ I don't know how to lie my activity and my adapter

A: 

In fact , when user click on button, I would display a list above the first one. So I think about AlertsDialog to do that. And if user click on the entire row, I display another activity.

But like the OnClick is on the Adapter, I couldn't retrieve position of the selected item of the list on the activity.

Actually the click on the entire row works, but not the click on the button which is on the row.

Nanis
Please don't post more details to a problem as an answer. Just edit your question
Alex Volovoy
sorry, I didn't pay attention that we can just add a comment.
Nanis