A
A
Anton Shelestov2020-04-24 16:08:22
android studio
Anton Shelestov, 2020-04-24 16:08:22

Additional data for an element?

Hello!

Suppose there are several buttons generated by Button on the page, when clicked, AlertDialog opens.
And the question is, is it possible to add additional parameters to the generated button so that I can get them and understand from which button the dialog was opened?

For example, from the life of html tags, they have data attributes: Is this possible in android? Thank you!
<button data-url="..." data-id="...">Save</button>


Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Timur Pokrovsky, 2020-04-24
@ShelestovAnt

All elements have a tag attribute - you can stuff anything into it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question