9 ways to avoid memory leaks in Android

What are memory leaks?

So how do I check if my app is leaking?

So what are some of the common mistakes that lead to memory leaks?

1. Broadcast Receivers:

2. Static Activity or View Reference:

3. Singleton Class Reference:

This was actually an example I had to use in an app of mine: for REST services.

4. Inner Class Reference:

5. Anonymous Class Reference:

6. AsyncTask Reference:

7. Handler Reference:

8. Threads Reference:

9. TimerTask Reference:

Android Developer @ Automattic https://github.com/anitaa1990

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store