I used to implements the progress of "downloading sth" in a worker thread,
and new a thread when u choose the corresponding option in the menu ( overriding onOptionsItemSelected funciton) yet the UI will be frozen once you choose the download option in the menu Is using asynctask instead the better solution??? Whats the difference between thread and asynctask??? Any response is greatly appreciated. Thanks, Molee On 1月3日, 上午1時10分, Kumar Bibek <[email protected]> wrote: > If the service is coupled to your UI, I think AsyncTask would be a > better solution. Look at the examples for the same. > > But, if the service is completely separate from the UI, then you have > to bind to the service, and then check it's progress. > > Thanks and Regards, > Kumar Bibek > > On Jan 2, 4:54 pm, fhucho <[email protected]> wrote: > > > Hi, > > I have a service that downloads something from the Internet, it shows > > progress in notifications and in MyActivity (only when MyActivity is > > on foreground of course). How should the service post the progress to > > MyActivity? I know this could be done somehow with IBind but can I > > just simply do this in MyActivity: > > > MySevice.myActivity = this; > > startService(new Intent(....)); > > > ? > > From MyService I can now call MyActivity's methods because I have a > > static reference to it in MySevice.myActivity, so I can call e.g. > > myActivity.sendProgress(63). -- 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

