android - Add XML content to a View -
im need to develop an application and I need to add elements dynamically. I wonder if I can get my current activity I can add elements (stored in XML file), such as internal HTML in Javascript
I tried LayoutInflator but it changes all the content and I need to add.
Thank you!
The easiest way to do this is to use LayoutInflater as you said. I'm not sure how you were doing this (so I asked to see your inhaling code), but the simplest way to understand is to:
LayoutInflater inflater = getLayoutInflater (); ViewToAppend = see inflater.inflate (R.layout.some_layout, tap); // Optional, create layout params and apply to see it with the // viewToAppend.setLayoutParams (parameter); mainView.addView (viewToAppend);
Comments
Post a Comment