• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps how to make a Service and AsyncTask comunication

tsue

Lurker
hello, i have this issue:
I have a main activity that is binded to the service,
Also that main activity can call a class(AsyncTask) that is a client to connect to a server and waits for data

i tried to make the bind from class(AsyncTask) client to the service,
but i dont know if thats not possible
or do i have to return data to main activity so main activity can send it to the service?

i can do this in the main class

Intent intent = new Intent(getApplication(), ChatHeadService.class);
startService(intent);
bindService(intent, mServiceConnection, Context.BIND_AUTO_CREATE);

but how can i implement it in the class(AsyncTask) client?
 
Last edited:
Back
Top Bottom