Friday, November 18, 2011

Re: [android-developers] AsyncTask null exception for the activity reference in the doInBackground method while rotating.

Hi there! Sorry for posting here again, but i was hoping if i could try this sample, you said to put the synchronized in the detach method here:

void detach() {
activity=null;
}

in the asynctask, is this correct?but detach() is only called in the activity and not the in the async task itself, i thought synchronized methods assumed that they're both launched from 2 different threads....but in this case the activity(UI thread) calls the detach method like you said, but the async task doesnt, only the attach method...

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment