Is there any way to combine xml-based layout and "manual" layout? F.ex.:
I use the "standard" xml layout like this:
setContentView(R.layout.mainscreen);
And then I want to have some more dynamic contents, adding it like this:
LinearLayout layout = new LinearLayout(this);
setContentView(layout);
layout.addView(new CreateItemButton(this, "Button", 1));
I realize of cours that I cannot create a new layout like in the line above, but I'd probably have to initialize the xml layout in some way. But - is it possible, or do I just have to go with a 100% manual layout if I want to dynamically add components? Or is there perhaps another, more elegant/correct way of doing it?
(What I want to do is create buttons based on entries fetched from a database. These will wary in number and text/contents, hence the attempt to add them dynamically instead of in the xml layout file.