Change text of edit text on button click inside list custom adapter

public void replaceItemAt(int position, String newText)
{
    //Replace the item in the array list
    this.textfieldarraylist.set(position, newText);
    //Let the custom adapter know it needs to refresh the view
    this.notifyDataSetChanged();
}
tag the position to button in adapter , 

button.setTag(position);
        button.setOnClickListener(new View.OnClickListener() {

            @Override            public void onClick(View v) {
//               int pos = (int) v.getTag();
                replaceItemAt( pos ,"1" );
                


            }
        });

Comments

Popular Posts