I am wondering if parent.removeView(child) actually removes child from the memory.
Or is it just the linkage between the parent and the child that is removed?
If the latter is correct, is there any way to remove the child view for the sake of memory allocation?
parent.removeView(child) actually removes the View from the View hierarchy, in other words removing the linkage between the parent and child.
Although memory allocation is handled by the virtual machine it self. If you have reference to the child you can make it null yourself. Doing this will make sure that when the garbage collector is called next time, your child object will be garbage collected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With