Android Studio – How do I pass R.drawable.XXX value to a function in kotlin?
Here's my code: private fun roomChange(animation: Int) { val rocketImage = findViewById<ImageView>(R.id.imageView2).apply { setBackgroundResource(R.drawable.animation) foxanim = background as AnimationDrawable foxanim.start() } } I have anim.xml file and would like to pass it to a function but "animation" is an unresolved…