I UNDERSTOOOOOD!  Finally!

in order to user the Activity methods, the best way is to run the
asynctask-extended class as an inner class of the Activity!

public class AsyncDemo extends ListActivity {

     .....

     private class DownloadFilesTask extends AsyncTask<URL, Integer,
Long> {
     ......
     }

}


a nice article explaining this:
http://www.rezendi.com/pa/2009/05/background-tasks-and-upfront-dialogs.html


Daniele



On 25 Set, 17:48, Daniele Baroncelli <[email protected]>
wrote:
> > i put up the progress dialog in the onPreExecute(). the activity can
> > then just call execute(), and is otherwise decoupled from the task
> > entirely.
>
> > i do all my HTTP stuff this way.
>
> I am definitely missing somethings, as I don't understand how I can
> show the progress dialog in the onPreExecute()
>
> 1) if the progress dialog is passed as a parameter to theasynctask:
> how can you access that parameter from the preExecute?
> as far as I understood you can access the parameters only from the
> doInBackground() method
>
> 2) if the progress dialof is instantiated in the onPreExecute():
> which value did you use for the context parameter required in the
> costructorProgressDialog(Context) ?
>
> I'll be very glad to anyone who would clear these doubts out
>
> Cheers
>
> Daniele
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to