Skip to content Skip to sidebar Skip to footer

Arraylist Not Updating After Using .clear()

I'm new to Android development, so please bear with me. I have a custom ArrayAdapter which I want to update by swiping down to refresh. I understand that in order to do this I need

Solution 1:

Move these two lines to after the if-else within the done of the Parse call.

adapter.notifyDataSetChanged();
swipeContainer.setRefreshing(false);

You currently are not waiting for the Parse call to finish before notifying the adapter.


Another solution is to change

absences.add(new Absent(name, desc, "employees"));

to

adapter.add(new Absent(name, desc, "employees"));

Post a Comment for "Arraylist Not Updating After Using .clear()"