i'm not so much talking about AsyncTask specifically (indeed i had a great day when i discovered this class), more as an example of one-use objects, which always seemed like kinda bad form to me. does it not seem like bad form to anyone else?
>Or use the ExecutorService (Future/Tasks/etc) in the >java.util.concurrent package. > >On Aug 7, 2:02 pm, Dianne Hackborn <[email protected]> wrote: >> If you don't like it, use your own Thread or the slightly higher-level >> HandlerThread and implement the semantics you want. >> >> On Fri, Aug 7, 2009 at 10:50 AM, Jason Proctor < >> >> >> >> >> >> [email protected]> wrote: >> >> > i'm fine with the single running instance model. not so much the >> > totally unreusable model, which is the one followed by AsyncTask. >> >> > java.util.Timer is the same way, but that's no excuse for imitation ;-) >> >> > > there is a difference in "can be used only once" and "single >> > >running instance is allowed" >> >> > >The correct is only single running instance is allowed. Once can get >> > >the status through getStatus and can take action accordingly e.g. >> > >cancel >> >> > >if (YourasynchSubClass.getStatus() == AsyncTask.Status.RUNNING) >> > > YourasynchSubClass.cancel(true); >> >> > >YourasynchSubClass.execute(parms); >> >> > -- > > > jason.software.particle -- jason.software.particle --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

