Answer the question
In order to leave comments, you need to log in
How to handle clicking on dynamically created buttons in android studio?
I create a dynamic array from CardView. CardView contains a button to open another activity.
I made a simple listener with a toast, when pressed, the button identifier is displayed.
The only problem is that the indicator is the same everywhere, and I need to open different activations.
How to properly handle the button click in this case?
Answer the question
In order to leave comments, you need to log in
If anyone needs it, you need to set the button.setId indicator.
After that, in the handler, you need to call the indicator and compare it with the necessary one.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question