Let's see if anyone can help me.
I have a Fragment
in which I have several TextView
with data and a RecycleView
. Within CardView
of RecycleView
I have a boton
for each item in the list. I want to press the button to update the values of TextView
that I have in Fragment
.
Putting in example .. the RecycleView contains a list of products that I have sold. and a TextView contains the total price of the sale. If I click on the CardView button, I remove one of those products. To update the value in the TextView.
public ViewHolder(View itemView ){
super(itemView);
contexto=itemView.getContext();
txtreferencia=(TextView) itemView.findViewById(R.id.txtreferencia);
txtcantidad=(TextView) itemView.findViewById(R.id.txtcantidad);
txtdescripcion=(TextView) itemView.findViewById(R.id.txtdescripcion);
txtdescripcion=(TextView) itemView.findViewById(R.id.txtdescripcion);
txtid=(TextView) itemView.findViewById(R.id.txtid);
btneliminar=(Button) itemView.findViewById(R.id.btneliminarpiezapedido);
card=(CardView)itemView.findViewById(R.id.cardpiezas);
// btnlocalizar=(Button)itemView.findViewById(R.id.btnlocalizar);
btneliminar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
borrar_pieza(Integer.parseInt(txtid.getText().toString()));
AQUI QUIERO ACTULIZAR LOS VALORES DEL FRAGMENT QUE CONTIENE EL RECYCLERVIEW
}
});
}
Thanks for the help.