Hi everybody!
I have a problem showing the connection state in my UI. First, I describe my situation:
I have an activity and a service. My main Activity launches the service and it connects to a Web service. Depends the response, the service take a state which i need to show in the UI.
For verifying the state of Service, the Activity creates a Thread, that asks for it each 10 seconds. It gets the result in a message and then launches a handler to evaluate the message and the handler modifies the TextView.
When I run the application, the system says me "System.err﹕ android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views."
I don't know how I can do it. Can everybody help me? Sorry for my english.
Thanks in advance.
I have a problem showing the connection state in my UI. First, I describe my situation:
I have an activity and a service. My main Activity launches the service and it connects to a Web service. Depends the response, the service take a state which i need to show in the UI.
For verifying the state of Service, the Activity creates a Thread, that asks for it each 10 seconds. It gets the result in a message and then launches a handler to evaluate the message and the handler modifies the TextView.
When I run the application, the system says me "System.err﹕ android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views."
I don't know how I can do it. Can everybody help me? Sorry for my english.
Thanks in advance.