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

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -