I think that the problem is that the calls to
actionOnData are not executing on the UI Thread.
Bear with me...
One thing that you can do to make the programming cleaner is to switch to using a pull parser to parse the messages that are generated by the service running at 192.168.62.23:1200.
Currently you expect data from the service to be:
This is rather brittle. What if your service responded with a true XML document:
You can parse this with a streaming XML parser:
Now, the
TcpHandler class is implemented as follows:
And
TcpListener is:
Your
TcpListen activity becomes:
Then get rid of the
callCompleted method.
All of the above is an extremely rough sketch of the idea, and it probably does not compile as I wrote it quickly outside of an
IDE. But, it should give you enough details to get started.
Try implementing this approach and posting the result.