Android Studio: Kotlin Random Number Generator not working?
I am using CardView in RecyclerView for displaying a list of City names.
Along with the city name, I would like to add a curved square image containing a random background colour and the starting letter of the city name, just like the default image of our Gmail accounts.
I have tried the following approach for generating a random index in the colours array and passing the colour to the ViewHolder class of my CustomAdapter.
colors.xml
#FFBB86FC
#FF6200EE
#FF3700B3
#FF03DAC5...