If I interpret this article correctly, passing the activity context to AsyncTasks
is a potential leak, as the activity might be destroyed while the task is still running.
How do you deal with this in AsyncTasks
that are not inner clases and need access to resources or to update the UI?
Additionally, how can you avoid leaking the context if you need references to progress dialogs to dismiss them?