Android studio kotlin code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Android studio kotlin code

Guys, this function is unable to read rb_aligator. idk why. I have named that as an id to a RadioButton. Please help fun onclick(view: View){ if (view == rb_aligator) }

19th Apr 2022, 7:43 PM
RihsabMar
RihsabMar - avatar
1 Answer
0
You a comparing a View to a radio button that holds a Boolean. To simplify it better, you have to do a condition to the radio buttons in order to work. You can do the "if-else" or the efficient way is use "when()" and putting a boolean condition or Int to it.
7th May 2022, 10:39 AM
Georgi Tasev
Georgi Tasev - avatar