Is there any trick to click radio button with code ? I've already tried radioButton.setChecked(true) and .setSelected(true). But that's not I want. That two methods can't trigger the event of the button. I wrote an onclick listener for each radio button that makes an EditText appears under the clicked button. So, I need a method like radioButton.click() if possible. Thanks..
The setChecked and setSelected only change the state of the button. You could use performClick() to obtain a simulated click on the button.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With