I\'ll keep this one as simple as I can.
I have a method in my control layer that uses a class CallServiceTask that extends AsyncTask. When
as @saad-farooq mentioned you can use interface for that. So you can use the Handler.Callback or define your own:
public interface ClientIF {
public void onResponseReceived(Object result);
}
then you need to implement it in your CallServiceTask
public abstract class CallServiceTask extends AsyncTask
note that the costructor is changed so you can call from every Activity class. Then make the instance of this class in your RestClient
public class RestClient
{
CallServiceTask service = new CallServiceTask() {
@Override
public void onResponseReceived(Object result) {
// TODO Auto-generated method stub
}
};
}