Android Question Theading question Service Module

rkxo

Active Member
Licensed User
Longtime User
Hi,
Is it possible to call a function in main class that will update the controls from a thread in a service module?

example.
Main class

Sub Activity_Create(FirstTime As Boolean)
StartService(SQLSERVICE)
end sub

sub update()
text="abcdefghi...."
end sub

service module SQLSERVICE
thread.start("sql",null)

sub sql()
connect database......etc
...
...
thread.RunOnGuiThread(Main,"Update",Null) 'error
end sub

if i call with CallSub(Main,"update")
appears android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
Thanks
 
Last edited:
Top