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);
--
Best Regards,
Atif Gulzar
I ◘◘◘◘ Unicode, ɹɐzlnƃ ɟıʇɐ
On Fri, Aug 7, 2009 at 6:14 AM, Dianne Hackborn <[email protected]> wrote:
> If they have state associated with them, it can avoid a lot of errors to
> not re-use a stale object.
>
> On Thu, Aug 6, 2009 at 4:27 PM, Jason Proctor <
> [email protected]> wrote:
>
>>
>> i must admit i don't quite understand these implementation decisions.
>> one-use classes don't make much sense to me. why not make something
>> reusable if you can?
>>
>>
>>
>> >An AsyncTask instance can be used only once indeed. And they're not
>> >meant to be created/started dozens of times per second so the GC will
>> >be just fine.
>> >
>> >On Thu, Aug 6, 2009 at 4:00 PM, Jason
>> >Proctor<[email protected]> wrote:
>> >>
>> >> is it true that AsyncTasks can only be executed once? IMHO they
>> >> should be reusable, one-use classes just give the GC more of a job.
>> >>
>> >> --
>> >> jason.software.particle
>> >>
>> > > >
>> >>
>>
>>
>> --
>> jason.software.particle
>>
>>
>>
>
>
> --
> Dianne Hackborn
> Android framework engineer
> [email protected]
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails. All such
> questions should be posted on public forums, where I and others can see and
> answer them.
>
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---