samedi 15 août 2020

What kind of array or list should I use to complete my randomization code?

    button.setOnClickListener {
        //???
        val rand = Random().nextInt()
        phrase.text=rand.toString()}

This is my code so far, but I can't seem to find an array that fits, or listOf, it always seems to end up with an error, is there something wrong with the code? My goal here is to write a couple of phrases that will be chosen randomly once the button is clicked.




Aucun commentaire:

Enregistrer un commentaire