对于我的listview的每一行,我有一个textView和2按钮,它与onItemclickListner一起工作,但我想用按钮
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));
在main.xml中我有listview,在affiche.xml中我有textview和2个按钮..
我该如何做到这一点?