https://kotlinlang.org logo
#announcements
Title
# announcements
a

avovk

10/31/2017, 11:53 AM
@neuber This line here:
buttone1.setOnClickListener { viewModel.setDrawable() }
You can change it to something like this:
buttone1.setOnClickListener { viewModel.setDrawable(context = this) }
Then change the function you are currently editing to this:
Copy code
fun setDrawable(context: Context) {
    back.setDrawable(context.getResources()./*the rest*/)
}
That should help
n

neuber

10/31/2017, 3:04 PM
hi
2 Views