My app is all about manipulating and showing different views of a particular entity. I have a class called Item
that defines an entity in my app. I have created a custom layout that knows how to render a particular version of Item
s:
public class MyItemLayout extends FrameLayout {
public MyItemLayout(Context context, AttributeSet attrs) { ... }
}
I would like to be able to reference this in XML:
<MyItemLayout .../>
What I don't understand yet is:
- How do I reference this in XML?
- How do I set the
Item
instance for the element? I can't do that in XML (or can I?), so how would I do it in code?
Thanks.