This happens during orientation changes, correct?

What you have is two threads accessing and modifying the same variable "at the same time".

Take some time to learn about multithreaded programming in Java: concurrent access and modification of a variable is one of the things that fall under this topic.

One easy way to ensure correct access / modification is to use this helper class built into Java (and Android):

http://developer.android.com/reference/java/util/concurrent/atomic/AtomicReference.html

-- Kostya

26.10.2011 19:56, Bluemercury ?????:
yes, but how can i get the method from the activity that contains the logic to do in the background from the context, is this possible? im getting null exception for the activity after verifying if the activity is not null:

               if(activity!=null){
return activity.doBackGroundRequest();
}else{
Logger.write("QuadrosMobileActivityTask ", "AsyncTask finished while no Activity was attached.", Logger.INFO);
return null;}

}
--
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

--
Kostya Vasilyev

--
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

Reply via email to