Hi, I am creating an Android application that uses checkboxes, I am wondering if it is better to use OnCheckedChangeListener to do something when the state of the checkbox has been changed or it would be better to use OnClickListener with if inside it, which runs every time the checkbox is checked or unchecked? Thanks
With OnCheckedChangeListeneryou, you get an event whenever the checked state changes, even when it is executed in code using .setChecked().
OnCheckedChangeListener
.setChecked()
, , (, , , , ).
, , , , OnClickListener.
OnClickListener
Source: https://habr.com/ru/post/1532865/More articles:Unable to add service client for net.tcp WCF service - c #What is the correct way to share data between AppWidgetProvider and RemoteViewsService.RemoteViewsFactory - androidHow to override default answers on mockito mock? - javaПроблема IE8 с функцией вызова через пространство имен - javascriptMVC 4 authentication (infinite login) - asp.net-mvc-4Hungarian algorithm matching one set - algorithmgenerating a matrix, applying a function to all possible combination of variables in r - functionДополнительные строки в обычном текстовом письме через SendGrid - c#extra lines in text messages sent via sendgrid - phpmailerHow to get a user registered through InMemoryAuthentication using Spring Security? - javaAll Articles