Android Asynchronous calls
<p>Im making an asynchronous call from a class to another.</p>

<p>Here is my actual code:</p>

<pre><code>public class HttpRequestHelper extends AsyncTask
{

  @Override
  protected Object doInBackground(Object... params) 
  {
   try 
   {
      // Create a URL for the desired page
      URL url = new URL("http://www.google.com");
      // Read all the text returned by the server
      BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
      String str;
      while ((str = in.readLine()) != null) 
      {
      }
      in.close();
    } 
    catch (MalformedURLException e) 
    {

    }    
    return null;
   }
   protected void onPostExecute(Long result)
   {
        String hello="hello world";   
   }
}
</code></pre>

<p>Im using the class above from another class using:</p>

<pre><code>HttpRequestHelper helper=new HttpRequestHelper();
helper.execute("whatever");
</code></pre>

<p>But after execute, i dont know when the execution is finished, how could i suscribe to the callback of the asynchronous operation?</p>

<p>Thanks in advance.</p>

<p>Best Regards.
Josema.</p>
