Hi at all,

I have to put some ImageButton inside an LinearLayout, but I don't
know the number of this statically, so because I keep the data through
internet at run-time.

I solved this problem adding new child at the layout at run time after
the oncreate() functions is called in this way:

ImageButton b;
LinearLayout contanier = (LinearLayout)
findViewById(R.id.card_images_layout);
for (int i = 0; i < this.card.images.size(); i++) {
  b = (ImageButton) findViewById(R.id.card_image);
  b.setImageBitmap((this.card.images.get(i).getImage_data()));
 contanier.addView(b);
}

But I take this error

java.lang.IllegalStateException: The specified child already has a
parent. You must call removeView() on the child's parent first

Is my solution which is incorrect or I make wrong something?

Thanks a lot

pedr0

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

Reply via email to