<How to convert image name to string after randoml...
# stackoverflow
u
How to convert image name to string after randomly selecting from folder I'm quite new to progamming. So here's my function to select a random image in my drawable folder. fun generateimage(index:Int) {var images=arrayOf(R.drawable.img1,....) main_imageView.setImageResource(images[index]) This works as an image is shown randomly every time I start the application. But I would like to be able to know which image was selected. Preferably from retrieving the image name to string.