public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View itemView = inflater.inflate(R.layout.joinlistviewitem, parent, false);
resultp = data.get(position);
name = (TextView) itemView.findViewById(R.id.personname);
name.setText(resultp.get(Joinlistview.RANK));
Button deletejoin=(Button)itemView.findViewById(R.id.delete);
deletejoin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//resultp.get("userId");
// TODO Auto-generated method stub
Log.e("delete clicked", "delete clicked");
Toast.makeText(context,"clicked"+resultp.get(Joinlistview.RANK), Toast.LENGTH_SHORT).show();
}
});
return itemView;
}
I used the above code for button click on listview.If i click a button it sows the user name with its position. But it displays the same name in all position.??How to solve this??