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# - SharpSVN - How to get the previous revision? -

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

url - Querystring manipulation of email Address in PHP -