Kotlin Convert String to Resource ID for View
I need to be able to edit a View, using a string to fetch the View ID. I have named the TextView object "cell1", and there are many like it (cell2, cell3, etc). I need to be able to change a select cell based on a given integer.
My XML:
My Kotlin class:
val binding: GridmapBinding = GridmapBinding.inflate(layoutInflater) //creates binding
var getCell = ("cell" + 1) //creates variable to combine cell and an integer
Log.i("Debugging", "onCreate: $getCell") //made sure it comes out as 'cell1'...