0

For each line of my listview i have a textView and 2 button, it work with the onItemclickListner but i want it with button

final ArrayList<String> listvendeurtri = new ArrayList<String>();

Button b = (Button) findViewById(R.id.button1);
b.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v1) {
        Collections.sort(list, new comparatorprix());

        for (Vendeurs v : list) {
            listvendeurtri.add(v.getNom() + "  --->  "
                + v.getPrix() + "   dt");
        }

        final ListView listView = (ListView) findViewById(R.id.listView1);
        listView.setAdapter(new ArrayAdapter<String>(Main.this, R.layout.affiche, R.id.textView5,listvendeurtri));

In main.xml i have the listview and in affiche.xml i have textview and 2 button..

How can I make this work?

LU RD
  • 34,438
  • 5
  • 88
  • 296
Wassim
  • 13
  • 5
  • 1
    Try this : [ListView elements with multiple clickable buttons](http://stackoverflow.com/questions/1709166/android-listview-elements-with-multiple-clickable-buttons) – ρяσѕρєя K Mar 21 '12 at 11:52
  • try this: http://stackoverflow.com/questions/9513411/android-list-view-containing-buttons-and-textview-no-longer-selectable/9513478#9513478 – Sadeshkumar Periyasamy Mar 21 '12 at 12:04

0 Answers0