MobDev wrote: > Hi, > I am using an AsyncTask to start out a sequence of events to retrieve > data from the net, parse this data and then write it to the > Database... > I have divided my code into several modules, one for networking > operations (which is used for retrieving the data), one for xml- > parsing, and one for DB funtionality... The first one calls the second > one when it's done and so on... > So now I was wondering if there is some correct way to make an > AsyncTask "public" so that everyone of those modules is able to call > the progressUpdate() method to show the user what the general progress > is (like placing a horizontal progress bar on 1/3 when the data has > beendonwloaded, on 2/3 when the parsing is done and 3/3 when it's done > writing to the DB)...
IMHO, the AsyncTask should be the driver, not be driven, so you would not need the AsyncTask to be public. The AsyncTask should know when you are 1/3 complete, 2/3 complete, etc. because it is one calling your other modules to have work be completed. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android 2.x Programming Books: http://commonsware.com/books -- 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

