Skip to content Skip to sidebar Skip to footer

Textview Not Updating When Deleting Record In Custom Adapter

I have a class which shows record in a ListView. The user can delete the records and everytime the user deletes a record I want to update a TextView from my layout with the new val

Solution 1:

Make sure you're getting the right TextView when calling findViewById. I believe your tv is not the TextView object you need. You should use findViewById in the correct context. If you're working on the views that are already there you don't need to inflate anything new. find it by id or pass the reference to the view any other way.

Solution 2:

Change this

getTotalIncomesAndExpenses();
 notifyDataSetChanged();

to this

notifyDataSetChanged();
 getTotalIncomesAndExpenses();

may be a reason.

Post a Comment for "Textview Not Updating When Deleting Record In Custom Adapter"