StrongReference of AsyncTask
Opened this issue · 3 comments
au.com.wallaceit.reddinator.activity.ViewAllSubredditsActivity.DLTask is an inner class of au.com.wallaceit.reddinator.activity.ViewAllSubredditsActivity, which means The AsyncTask class holds strong reference to the Activity. In other words, there is a potential memory leak danger.
I think DLTask should be changed to a static class or outter class. Thank you.
I may be wrong but since the class is initialized into an object it doesn't matter that it's an inner class. Just like before, once the async task ends then it's object will be disposed. If the activity is disposed before that it is also fine.
Are you new to Java by any chance? You sound like a C programmer :-D
If you are interesting in contributing to the project I can send you a few stack traces from the Play console. I haven't had much time to work on this project in the last year or so. It could use some love.