title: Returning result of AsyncTask to calling activity in android app
body: <p>I'm looking to connect my android app to a WCF RESTful webservice and so far am doing allright on getting it set up. However now I'm at the point of splitting out the execution onto the background thread via AsyncTask&lt;></p>
  
  <p>Rather than have the AsyncTask classes embedded within the activity .java files though, I would prefer to split them out to a separate package so they can be used by multiple activities and fragments within the app, however (and I may be missing something obvious here), how do I then marshall the result of the AsyncTask back to the calling Activity? I understand that I will get the result of doInBackground() passed to onPostExecute() - but then how do I pass the result back to the calling activity or fragment? </p>
  
  <p>Similarly how can I call progress notifications back on the parent activity as the separate AsyncTask&lt;> classes will have no knowledge or visibility of UI components.</p>
  
  <p>In C# I would probably have passed through a callback delegate to the constructor of the AsyncTask&lt;> pointing to a method on the parent activity and then invoked the callback delegate with the params of the result when the task finished. Is it something similar with Android?</p>