[android-developers] Access instance variables from an activity inside a AsyncTask

2011-05-16 Thread elioncho
Hello guys, I have an AsyncTask (in a separate file) which is invoked on an activity. When I instantiate the AsyncTask, I send the activity as a param. How can I access the acitivity's instance variables from the onPostExecute method of the AsyncTask? Thanks! -- You received this message

Re: [android-developers] Access instance variables from an activity inside a AsyncTask

2011-05-16 Thread Mark Murphy
On Mon, May 16, 2011 at 7:37 PM, elioncho elion...@gmail.com wrote: I have an AsyncTask (in a separate file) which is invoked on an activity. When I instantiate the AsyncTask, I send the activity as a param. How can I access the acitivity's instance variables from the onPostExecute method of

Re: [android-developers] Access instance variables from an activity inside a AsyncTask

2011-05-16 Thread Satya Komatineni
In addition to what Mark has pointed out keep in mind that when the device is rotated the activity is restarted but not the asynctask. So you will end up with a null activity variable. It is fairly well documented on the android developer site how to deal with device rotation or configuration