Custom Attributes in Android

Posted by Arun on Stack Overflow See other posts from Stack Overflow or by Arun
Published on 2010-12-31T06:53:09Z Indexed on 2010/12/31 8:53 UTC
Read the original article Hit count: 199

Filed under:
|

I'm trying to create a custom attribute called Tag for all editable elements. I added the following to attrs.xml

<declare-styleable name="Spinner">
    <attr name="tag" format="string" />
</declare-styleable>

<declare-styleable name="EditText">
    <attr name="tag" format="string" />
</declare-styleable>

I get an error saying "Attribute tag has already been defined" for the EditText. Is it not possible to create a custom attribute of the same name on different elements?

© Stack Overflow or respective owner

Related posts about android

Related posts about custom-attributes