I'm using a control that I've created that may display several different UI layouts depending on the required situation many times over the course of the activity lifetime (which could be days without reboot/restart). Each UI layout may have 500 or more views contained therein which I do have record of in a standard LIST object.
This leads to my question: When clearing out the current layout in favor of displaying/loading a new layout, which method below is optimal or does it matter at all to the Android garbage collector?
- Individually .RemoveView on each UI element then clear my list of UI elements.
- Just use .RemoveAllViews on the UI parent panel then clear the list of UI elements.
- Just clear the list of UI elements and .Initialize the parent panel again.
- Some other procedure I've missed in the seemingly endless plethora of Android API updates.
I'm coming from a .NET background and I'm very OCD when it comes to Using/End Using and making sure I .Dispose objects. In .NET I've been caught by memory leaks/connection pool issues many times in the past due to this. The
lais sez-faire resource allocation of Android devices confuses/concerns me.
Thanks in advance for any input.