Hi,
Im making an asynchronous call from a class to another.
Here is my actual 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";
}
}
Im using the class above from another class using:
HttpRequestHelper helper=new HttpRequestHelper();
helper.execute("whatever");
But after execute, i dont know when the execution is finished, how could i suscribe to the callback of the asynchronous operation?
Thanks in advance.
Best Regards. Josema.