[android-developers] Dynamically adding view in layout xml in android

2011-02-15 Thread Deepak Kumar
Hi All, I have created a xml layout which includes ImageButtons in row,col format.So,layout having some initial number of views.Now,I want to add extra views at run time i.e through code.Is it possible? How to do it? Thanks, -- You received this message because you are

Re: [android-developers] Dynamically adding view in layout xml in android

2011-02-15 Thread Kostya Vasilyev
Yes, it's possible. First you need to create the new views to be added: either from code with new TextView or whatever, or by using LayoutInflater to create a view hierarchy defined within XML. The second step is adding them to the parent: get a reference to a ViewGroup that you would like