Hi everyone. Just getting started with developing for Android, so
apologies if there's an obvious answer.

I'm working on an application in which it's necessary to
programmatically change the entire structure of the UI. What I would
like to be able to do is specify a subtree of the UI in xml, and then
instantiate that multiple times as required throughout the tree. For
instance, if I need the user to set a numerical value, I'd like to use
xml to define all the widgets involved, increment and decrement
buttons for instance, and then reference this same file whenever I
need a UI of that sort.

Unfortunately, When I inflate the xml multiple times, I get the
following exception.

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

This I'm assuming is because Inflating isn't creating a new object
each time, but rather creating a static singleton. Is there a good way
to do what I'm hoping to do, or should I abandon trying to use the xml
interface?

-Ryan

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to