There is a Fragment in which there is a TextView . How to get access to TextView from the адаптера ? When deleting a category from the list, you need to update the price, I don’t know how to access the view from the adapter, it can be explained somehow it is not clear, but I attached screenshots

enter image description here

enter image description here

enter image description here

  viewHolder.tvDelete.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mItemManger.removeShownLayouts(viewHolder.swipeLayout); studentList.remove(position); notifyItemRemoved(position); notifyItemRangeChanged(position, studentList.size()); mItemManger.closeAllItems(); Toast.makeText(view.getContext(), "Deleted " + viewHolder.categoryName.getText().toString(), Toast.LENGTH_SHORT).show(); myDb = new DBDataSource(mContext); dbHelper = new DBHelper(mContext); try { if(type == true){ myDb.deleteTask(myDb.getIdOfTransaction(item.getdateToDeleteItem()), true); }else{ myDb.deleteTask(myDb.getIdOfTransaction(item.getdateToDeleteItem()), false); } //Log.d(LOG_TAG,"item.getDate() = " + DBDataSource.makeDate2(item.getDate(), true)); } catch (SQLException e) { e.printStackTrace(); } dbHelper.close(); } }); 
  • and what happens to the Fragment? Switches to another, as I understand it, by some kind of click? If so, click on the fragment to be closed? - Boris Safonov
  • @BorisSafonov, the adapter has a delete button handler, deletion occurs, but the textview is not updated with the amount, the question has been updated - java

0