Thursday, July 14, 2011

Re: [android-developers] Add xml layout in another view

You can't add the same view to a layout multiple times.

So rather than doing this:

15.07.2011 0:52, Goutom пишет:
> View view = layoutInflater.inflate(R.layout.listitem,null);
> for (int i = 0; i < 5; i++) {
> linearlayout.addView(view);
> }

Do this:

for (int i = 0; i < 5; i++) {
View view = layoutInflater.inflate(R.layout.listitem,null);
linearlayout.addView(view);
}

--
Kostya Vasilyev

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment