I am trying to figure out how to change textview text on a long key press. I have included a screen shot to hopefully explain what i am trying to do.
the price table with the green +10.00. i want to be able to hold down on each price and have the keyboard pop up to edit the text field. i am new to programming and finding it difficult to search for proper terminology.
the code i have tried so far for this is:
(1..912).forEach {
val id = resources.getIdentifier("Price$it", "id", packageName)
val tv = findViewById<TextView>(id)
when {
onKeyLongPress(id, setText()) -> tv.text.getText()
}
}
having 912 prices i grouped them to reference the ID of each. Instead of trying to apply any code on individual prices. i am aware the onKeyLongPress()
is not correct usage. i stated it like that to help me understand what i wanted to do even though that would not work. Reading through reference material on key presses has left me confused. i don't know where to go from here any information is greatly appreciated. Thank you for your time.