How can I customize my layout.xml from code before calling setContentView(View) function?

Posted by Marton_hun on Stack Overflow See other posts from Stack Overflow or by Marton_hun
Published on 2013-08-02T15:20:31Z Indexed on 2013/08/02 15:36 UTC
Read the original article Hit count: 125

Filed under:
|
|
|

I would like to customize my layout definition (declared in my_layout.xml file) from code.

Unfortunately I can use findViewById() function to find the specific views (defined in my_layout.xml file) and customize them from code only after I called setContentView(R.layout.my_layout).

But what if I want to customize my layout first, before calling setContentView()? How can I access the specific views before calling setContentView()?

© Stack Overflow or respective owner

Related posts about android

Related posts about layout