Below you will find pages that utilize the taxonomy term “Memory leak”
September 10, 2017
Android memory leak
Leak because of system bug PhoneStateListener leak Below 7.0 a non static inner class IPhoneStateListener.Stub callback in PhoneStateListener references to outside PhoneStateListener, even caller has been destroyed and “un-registered” the PhoneStateListener, the references coming from: Native Stack –> PhoneStateListener –> Context(Activity).
A wrapper class wraps a weak reference of PhoneStateListener can be used to avoid this memory leak.
Caution: The original PhoneStateListener object must be referenced by caller class, otherwise the weak reference in the wrapper class will get null.