KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
When creating a custom component in android it is often asked how to create and pass through the attrs property to the constructor. It is often suggested that when creating a component in java that you simply use the default constructor, i.e. new MyComponent(context); rather than attempting to create an attrs object to pass through to the overloaded constructor often seen in xml based custom components. I've tried to create an attrs object and it doesn't seem either easy or at all possible (without an exceedingly complicated process), and by all accounts isn't really required. My question is then: What is the most efficient way of construction a custom component in java that passes or sets properties that would have otherwise been set by the attrs object when inflating a component using xml?
Tags (comma-separated)
Save Edits
Cancel