I think I've read pretty much all the answers to all of the similar SO questions, and NONE of them seem to be working for me. It's driving me nuts, and I've spent too much time on this.
I'm implementing a RecyclerView
here and I can't for the life of me update it's children. What happens is that after I update nothing changes on the screen, UNLESS I start scrolling. Once I scroll it updates perfectly.
This is my code:
public void updateDataAtIndex(final int indexToUpdate, ReadableMap updatedChild) {
if (updatedChild != null) {
if (this.data != null && this.data.size() > indexToUpdate) {
this.data.set(indexToUpdate, updatedChild);
final SPAdapter self = this;
new Handler(Looper.getMainLooper()).post(new Runnable() {
public void run() {
System.out.println("\n@@@@@@@@@@@@@@@@@ Updating: "+indexToUpdate);
self.notifyItemChanged(indexToUpdate);
}
});
}
}
}
Here's the full adapter: https://github.com/SudoPlz/react-native-synchronous-list/blob/master/lib/android/src/main/java/com/sudoplz/rnsynchronouslistmanager/Views/List/SPAdapter.java#L109