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
)的父类吗?这样做的标准方法是什么?