Usually the activity has a predefined layout which is described in the xml file. What if I know the exact number and types of UI elements only during the runtime?(for example, I need to display as many TextBoxes as user defined) Is it possible to create an activity with a layout defined during runtime and if it is, how?
Share
First set an identifier to a view, where you want to insert your views at runtime :
Then you can add child views to this LinearLayout programatically, whenever you want :