I have this two classes. My main Activity and the one that extends the AsyncTask
, Now in my main Activity I need to get the result from the OnPostExecute(
You can call the get() method of AsyncTask
(or the overloaded get(long, TimeUnit)). This method will block until the AsyncTask
has completed its work, at which point it will return you the Result
.
It would be wise to be doing other work between the creation/start of your async task and calling the get
method, otherwise you aren't utilizing the async task very efficiently.