I have a Service running in my app..
This Service has an object for sending message to the server and a function to get that object and use it.
The object is initialized from the Service and yet when the UI gets this objects and use it - it looks like it uses it on the UI Thread..
Is this correct ? Is there a way i can make my object always run from the Service Thread ?
public class ServerMessagesManager extends Service {
private ServerMessagesReceiver serverMessageReceiver;
@Override
public void onCreate() {
super.onCreate();
this.serverMessageReceiver = new ServerMessagesReceiver(app);
}
public ServerMessagesReceiver getServerMessagesReceiver()
{
return serverMessageReceiver;
}
}