Is there a way to get the parameters from a XML view, modify some stuff on it and then use it as content view ?
Let’s say I have a normal LinearLayout and I want to make that work:
LinearLayout layout = (LinearLayout) findViewById(R.layout.main);
setContentView(layout);
Instead of :
setContentView(R.layout.main);
Yes.
To be more specific, we need more specific info from you.
Edit
You can, for example, do the following.
Say you have in your xml specification a TextView:
Now you want to center horizontal the TextView programmatically:
You just set the contentview at the start, and don’t need to set it again when you change the variables.