public class ListingFoundBeaconService
extends AsyncTask {
public ListingFoundBeaconService(Context contextGi
Best way is to call delegate. In your AsyncTask
class make a constructor and have a delegate
Delegate interface:
public interface TaskDelegate {
public void taskCompletionResult(String result);
}
now in AsyncTask
:
private TaskDelegate delegate;
public ListingFoundBeaconService(Context contextGiven,
JSONObject jsonParams,
TaskDelegate delegate) {
this.contextGiven = contextGiven;
this.jsonParams = jsonParams;
this.delegate = delegate;
}
on postExecute
:
delegate.taskCompletionResult(result/msg/json);
In your main class implement TaskDelegate
and implemented a method which is called when the task completed.
Make the ListingFoundBeaconService class abstract and then override onPostExecute in the calling class.