[RecyclerView ] Inconsistency detected. Invalid item position
Beberapa waktu lalu saya sering menemukan masalah terkait recyclerview. Salah satunya adalah error Inconsistency detected. Invalid item position. Error iniĀ kadang sulit untuk di repro/ di trigger, terjadi begitu saja.
This is the java.lang.IndexOutOfBoundsException which can be introduced in many scenarios with a improper coding for updating RecyclerView adapter or its item like: when if you try to change/insert/remove in adapter view item and at the same time you are trying to set new adapter. Sometimes you found you are not able to reproduce this issue but it is coming inconsistently.
Menurut Rahul Dhanuka, error ini bisa terjadi ketika mencoba untuk mengubah/menambah/menghapus data pada adapter dan set adapter baru pada waktu bersamaan.