java - May I store View objects in instance fields? -


i've got activity class. should nice find views need in oncreate, , reference these fields, without calling findviewbyid. ok so?

can't views assigned different objects @ runtime? e.g., true findviewbyid(res1) == findviewbyid(res1) @ time?

you can create instance variables views in activity. ,

findviewbyid(res1) == findviewbyid(res1) 

is true long layout not inflated again or other changes (replacing views) made content view.

but not keep references views in objects live longer activity holding views. in singleton! (see see avoiding memory leaks)


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

c# - SharpSVN - How to get the previous revision? -

php cli reading files and how to fix it? -