I think you must be misreading the documentation. If so, let's see if this makes it more clear:
Variables are not objects. Variables refer to objects. So when the documentation says you can't reuse an async task, it means you can only run that OBJECT once. But if you create a NEW instance (as Romain Guy suggests), it is a new object, unrelated to the old, even if you store a reference to it in a variable which formerly referred to an old one. If you were a C++ programmer or a VB programmer in a former life, you may be thrown off by Java's syntax. Variables in Java always refer to objects, they are never "names of objects" themselves. In C+= terms, they're pointers, but without pointer arithmetic or the ability to point to dead objects or into arrays. (Arrays are likewise arrays of pointers anyway). On Apr 12, 6:27 am, Lee Jarvis <[email protected]> wrote: > I'm not sure if I'm going the right way about this.. but.. > > I have both username and password fields, as well as a login button. > When the login button is clicked I grab both the username and password > and attempt an online login. The authentication happens inside of an > AsyncTask so I can display a ProgressDialog. If the users attempt to > login failed, they should have another chance. But of course I'm > unable to repeat an already Finished AsyncTask. > > What would be a canonical work around for this? I'm under the > impression resetting a variable which contains an instance of the task > and re-applying it would be a 'bad thing'. > > Regards, > Lee -- 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 To unsubscribe, reply using "remove me" as the subject.

