Additional Id/tag for view?

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Additional Id/tag for view?

Postby ubit » Sun Jul 08, 2012 3:23 pm


i am trying to add additional info (in fact an id i created in a resource file) to a view (e.g. a button) via xml.

I defined the item:

<item type="integer" name="my_id">@+id/my_id</item>

Then i tried to use the id in a tag in the button:


of <button

If i retrieve the tag with getTag() it results in "@.....". The number after the "@" is correct, but i thought i can retrieve the number only. What the hell does the @ in front of "my" number?

Any ideas how i can create own id's (integer-numbers) and attach them via xml to a button?

What i really want is to retrieve this id and put it into a switch/case to decide which function the button should execute as i have to use different layouts with different buttons (and sometimes different buttons have the same function) that are "rooted" through a central dispatcher.

Best regards, Udo
Once Poster
Once Poster
Posts: 1
Joined: Sun Jul 08, 2012 3:12 pm


Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 4 guests