2017-11-28 5 views
0

제발, 프로덕션 버전에 나타나는이 버그에 대한 해결책을 찾는데 도움이되고 다음 로그의 버그가 정확히 어디 있는지 알 수 없습니다.어댑터 데이터를 업데이트 할 때 IllegalStateException이 발생합니다.

ListView.java line 1557 
android.widget.ListView.layoutChildren 

Fatal Exception: 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(2131558802, class 
android.widget.ListView) with Adapter(class 
android.widget.HeaderViewListAdapter)] 
    at android.widget.ListView.layoutChildren(ListView.java:1557) 
    at android.widget.AbsListView.onTouchEvent(AbsListView.java:3442) 
    at android.view.View.dispatchTouchEvent(View.java:7565) 
    . 
    . 
    . 
+3

아마도 'adapter.notifyDataSetChanged();'라는 데이터가 변경되었음을 알리는 데 실패했습니다. –

답변

0

당신은 메인 스레드에서 데이터를 변경할 수 있습니다

나는 Crashlytics에서 다음 로그 보고서를 얻었다.

백그라운드 스레드에서 데이터를 얻으려면 주 스레드에서 결과를 기다리고 데이터를 변경하고 adapter.notifyDataSetChanged()를 호출하거나 처리기를 사용하여 백그라운드 스레드의 주 스레드로 돌아가십시오 및 run() 메소드가 있습니다.

관련 문제