블로그 이미지
인간은 자신이 이해하지 못하는 것을 경멸하는 버릇이 있다. 셜병장

카테고리

분류 전체보기 (37)
주절주절 (1)
누리다 (1)
생활의 발견 (0)
Memory (1)
내 몸의 물 (8)
Developments (14)
Attraction (9)
Father Time (2)
Play Ground (1)
Total
Today
Yesterday

'IllegalStateException'에 해당되는 글 1건

  1. 2013.07.13 [Android/Exception] - java.lang.IllegalStateException

java.lang.IllegalStateException: 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. 


[in ListView(-1, class android.widget.ListPopupWindow$DropDownListView) with Adapter(class android.widget.Spinner$DropDownAdapter)] 


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() 호출하여 갱신하면 해결가능



'Developments > Android' 카테고리의 다른 글

주요 ADB 명령어 모음  (0) 2014.05.17
[Android/Tip] Interface  (0) 2013.07.13
[Android] Parcel  (0) 2013.07.13
[Android/Tip] ListView getView 중복 호출  (0) 2013.05.06
[Android/Tip] - adjustResize in Fullscreen  (1) 2013.04.17
Posted by 셜병장
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함