views:

29

answers:

0
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder;
        if (convertView == null) {
            convertView = mInflater.inflate(R.layout.listview, null);
            holder = new ViewHolder();
            holder.text = (TextView) convertView
                    .findViewById(R.id.TextView01);
            holder.button = (Button) convertView
                    .findViewById(R.id.TextView02);

            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }

        holder.text.setText(curr[position]);
        holder.button.setText(country[position]);
        holder.button.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {

                //Button b1 = (Button)findViewById(R.id.buton);
            }
        });
        return convertView;
    }

    static class ViewHolder {
        TextView text;
        Button button;
    }

link to full code In the above case, how do i add a listener to each of the buttons?