티스토리 뷰

IllegalStateException : 불법적인 상태에 대한 예외 / state 이동이 잘못된 상태에 발생한 에러


The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread

: Listview의 adapter가 변경된 상태를 알리지 않은 상태에서 재참조한 상황. 

결국 adapter를 쓰려면 Background thread로 돌지 말고 UI thread로 돌려라라는 의미


구조적인 문제로 100% 발생할수 있지만 타이밍적으로 발생가능성이 있음


동작 listview로 setAdapter한 상황에서 add된 상황에 대해 반환하지 않고 다시 setAdapter를 다시 호출할 경우 발생 (물론 경우의 수임) 결국 동기화 문제인가? ㅡ.,ㅡ

타이밍적인 문제라면 Adapter add 후에 notifyDataSetChanged() 호출하여 갱신하면 해결가능

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함