0

I am creating a table for my app where the user can add rows himself, the individual TextView elements will be clickable and open up a menu. But to do so i need the Ids of the elements. I need to assign them with variables, so i dont have a limited amount of rows. I also already found this solution, which works with a variable:

newText.setId(resources.getIdentifier("A$Row$Column", "id", this.packageName))

but this does always set the Id to 0

Jannis
  • 77
  • 7

1 Answers1

0

You can set int value in your setId function.. Like your row index

setId(rowIndex)

For more details, https://stackoverflow.com/a/15442898/6413387

towhid
  • 955
  • 2
  • 8
  • 19