public class ListingFoundBeaconService
extends AsyncTask<String, String, String> {
public ListingFoundBeaconService(Context contextGiven,
JSONObject jsonParams) {
this.contextGiven = contextGiven;
this.jsonParams = jsonParams;
}
protected void onPreExecute() {
super.onPreExecute();
pDialog = new ProgressDialog(contextGiven);
pDialog.setMessage("Loading list of active Beacons..");
pDialog.setIndeterminate(false);
pDialog.setCancelable(true);
pDialog.show();
Log.d("onPreExecute","onPreExecute worked" );
}
protected String doInBackground(String... args) {}
protected void onPostExecute(String file_url) {
// Two activities will need this thread so I have
// kept this as a separate class. Here I want to send a
// boolean value to the parent activity to show that
// the task has completed or not.
}
我能在onPostExecute()
函数中触发通知或完成事件监听吗?这样启动该类(ListingFoundBeaconService
)的父类将被通知。做此操作的标准方法是什么?