LogCat connected to: 0019097d09af6e
--------- beginning of /dev/log/main
main_mylogcatname_logcatdata (B4A line: 55)
ListViewLogData.AddSingleLine(data)
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:4925)
at android.view.ViewRootImpl.focusableViewAvailable(ViewRootImpl.java:2709)
at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:609)
at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:609)
at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:609)
at android.view.ViewGroup.focusableViewAvailable(ViewGroup.java:609)
at android.view.View.setFlags(View.java:8576)
at android.view.View.setFocusableInTouchMode(View.java:5734)
at android.widget.AdapterView.checkFocus(AdapterView.java:720)
at android.widget.AdapterView$AdapterDataSetObserver.onChanged(AdapterView.java:815)
at android.widget.AbsListView$AdapterDataSetObserver.onChanged(AbsListView.java:6546)
at android.database.DataSetObservable.notifyChanged(DataSetObservable.java:37)
at android.widget.BaseAdapter.notifyDataSetChanged(BaseAdapter.java:50)
at anywheresoftware.b4a.objects.ListViewWrapper.add(ListViewWrapper.java:177)
at anywheresoftware.b4a.objects.ListViewWrapper.AddSingleLine2(ListViewWrapper.java:133)
at anywheresoftware.b4a.objects.ListViewWrapper.AddSingleLine(ListViewWrapper.java:121)
at b4a.example.main._mylogcatname_logcatdata(main.java:413)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
at anywheresoftware.b4a.phone.Phone$LogCat$1.run(Phone.java:751)
at java.lang.Thread.run(Thread.java:856)
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
You should read the documentation of this library and if you have any specific question we can help you.
Another option is to explain what you are trying to accomplish. You also didn't write why creating a LogMessage sub that writes to the logs and to your ListView is not a good solution...