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
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(); } }); 

