I’m new to Android and I’m playing around with the sample code at http://developer.android.com/training/basics/fragments/index.html
If I want to update the article fragment (currently only a TextView) to include more elements dynamically, how do I do it?
Do I need to convert the article.xml to a layout first?
Maybe someone has a good bit of sample code for generating interfaces dynamically.
If I can understand right you want to add more UI elements to the existing layout…
You need to define an id for the layout in which you want to put in the elements..
say for example..
you reference this in the code like so in the onCreate like so..
so if you want to add elements dynamically you can just create them programmatically and add to the view like so..
you can add other elements as well…
your question is not very clear but based on what i;ve understood this is what you want.
just search for adding views dynamically in the search bar.