i have client-server app, I’m managing connections with Threads and handlers inside app, but maintaining synchronization between activities is quite hard, i though to make service that runs in background and contains thread.
In main activities i want just to get handler to that thread in service and put task by Handler.post(Runnable) method. Is it possible, and how to do this ?
i have client-server app, I’m managing connections with Threads and handlers inside app, but
Share
If I understood correctly, you can create service, run the thread inside, and create Handler for it. Then bind the service in activities and get the reference to the handler.