E. Fernandes
E. Fernandes

Reputation: 3997

How to pass XML file to layout custom attribute?

While developing a library module I decided to extern all UI attributes in a metadata file using XML - which will be latter validated againts a XSD schema. Currently I have both, XML and XSD, on assets folder of my project. I want to pass the XML reference in a custom attribute for my Custom View - doing something like app:cestyle="@assets/my_xml_file". Is that possible?

Upvotes: 0

Views: 201

Answers (1)

Roman Kolomenskii
Roman Kolomenskii

Reputation: 648

Assets are not mapped in R file so you can't access them like @string or @dimen, etc.

I would suggest either using a string resource that equals asset file name or res/raw folder to hold your xml files.

Upvotes: 1

Related Questions