Android Question question about views lifecycle when clearing the parent CLV

giggetto71

Active Member
Licensed User
Longtime User
Hello,
I have a fundamental doubt about views lifecyle. Specifically I would like to understand the following. Say I have a Custom List View and at some point I make a CLV.Add loading a layout file containing a certain number of views (say one label label1 and one EditText, EditText1). what happens when I clear the CLV to the views? I made a simple test a mad a log(EditText1.text) before the CLV1.clear and one after. surprisingly even after the CLV1clear command the log command did work and I got the same result of the log before the CL1.clear instruction. for some reasons I thought after CLV1.clear the views loaded with CLV.add were distroyed and not available anymore until the next load.

the reason why I ask is that I am fighting a "TransactionTooLargeException" error from the console and since I currently load few CLVs at runtime and keep them laoded even if they are not visible, I am evaluating to .clear the CLV's when they are not visible and load them again when needed. but if that does not make any difference..I will keep it as it is.

thanks
 

giggetto71

Active Member
Licensed User
Longtime User
ok thanks clear for the views. what does it happen to the relative global variable? in the example above to the global variables EditTex1 and Label1? do they remain "alive" or eventually they will be "nulled" by the OS ? would it make sense to programmatically null them after clearing the CLV?
 
Upvote 0
Top