WeakReference/AsyncTask pattern in android
问题 I have a question regarding this simple frequently occurring situation in android . We have a main activity , we invoke an AsyncTask alongwith the reference of the mainactivity , so that that the AsyncTask can update the views on the MainActivity. I will break down the event into steps MainActivity creates an AyncTask , passes its reference to it . AysncTask , starts it's work , downloading ten files for example The user changed the orientation of the device. This results in an orphan pointer