Listview 관련 Error
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
상황 : 현재 SM-T813 디바이스 에서 발생. 성능이 더 좋은 디바이스(SM-T815NO)에서는 발생하지 않는 이슈.
해결 : 참고 블로그의 말대로 UI 쓰레드를 돌리면서 진행. 다만, 이런 문제도 디바이스 성능이 뛰어나면 나오지 않는걸 보고, 디바이스가 너무 좋으면 코드가 개판이래도 돌아가니깐, 내가 짠 코드가 문제 없구나를 생각할 수 있구나를 생각했다.
12-27 11:37:41.764 16832-16832/com.devryu.tablet E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.iofit.tablet, PID: 16832
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. Make sure your adapter calls notifyDataSetChanged() when its content changes. [in ListView(2131624318, class android.widget.ExpandableListView) with Adapter(class android.widget.ExpandableListConnector)]
at android.widget.ListView.layoutChildren(ListView.java:1747)
at android.widget.AbsListView.onLayout(AbsListView.java:3008)
at android.view.View.layout(View.java:18856)
at android.view.ViewGroup.layout(ViewGroup.java:5954)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
at android.view.View.layout(View.java:18856)
at android.view.ViewGroup.layout(ViewGroup.java:5954)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
at android.view.View.layout(View.java:18856)
at android.view.ViewGroup.layout(ViewGroup.java:5954)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
at android.view.View.layout(View.java:18856)
at android.view.ViewGroup.layout(ViewGroup.java:5954)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741)
at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1730)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1496)
at android.view.View.layout(View.java:18856)
at android.view.ViewGroup.layout(ViewGroup.java:5954)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
at android.view.View.layout(View.java:18856)
at android.view.ViewGroup.layout(ViewGroup.java:5954)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:18856)
at android.view.ViewGroup.layout(ViewGroup.java:5954)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
at android.view.View.layout(View.java:18856)
at android.view.ViewGroup.layout(ViewGroup.java:5954)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:18856)
at android.view.ViewGroup.layout(ViewGroup.java:5954)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
at android.view.View.layout(View.java:18856)
at android.view.ViewGroup.layout(ViewGroup.java:5954)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at com.android.internal.policy.DecorView.onLayout(DecorView.java:908)
at android.view.View.layout(View.java:18856)
at android.view.ViewGroup.layout(ViewGroup.java:5954)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2652)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2368)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1519)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7113)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:927)
at android.view.Choreographer.doCallbacks(Choreographer.java:702)
at android.view.Choreographer.doFrame(Choreographer.java:638)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6780)
12-27 11:37:41.764 16832-16832/com.devryu.tablet E/AndroidRuntime:
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)
참고 블로그 : http://android-note.open-memo.net/sub/trouble--update-list-view-on-thread.html
참고 글 : http://tigerwoods.tistory.com/26