https://kotlinlang.org logo
#compose
Title
# compose
j

Jitendra

02/26/2020, 5:36 AM
Copy code
val testList = mutableListOf(testList0, testList1)

for (i in 0 until 2) {
    tableRow {
        for (j in 0 until 3) {
            Padding(5.dp) {
                //Cell
                Button(
                text = testList[i][j],
 onClick = {
     Toast.makeText(context,testList[i][j],Toast.LENGTH_SHORT).show()

                    
                    }

                )
            }

        }
    }
}
i want to show button text on click of Button, but here no way to get text,
a

Adam Powell

02/26/2020, 3:04 PM
Looks like you have everything you need here - the button gets its text from your own data in
testList[i][j]
so there's no need to get the text from the button itself