kotlin Get random string from array
问题 New to kotlin and quite a few questions and answers, mostly in Java. After following the documentation and verifying against numerous SO questions/answers Android Studio is complaining about the following in a function. The function is fun getRandomQuote() { val randomValue = Random.nextInt(quotes.size) //return quotes[randomValue] return quotes.get(randomValue) } quotes is an arrayOf(strings) val quotes = arrayOf("Alert today – Alive tomorrow.",...) It says for quotes.get(randomValue) That