Skip to content
Advertisement

Tag: onclicklistener

Why click on optionsMenu item doesn’t work?

I have a problem when clicking on an item from an options menu. I’ve read how to create a menu on the website https://developer.android.com/guide/topics/ui/menus and I seem to do it right, but it still doesn’t work. The menu exists, it is visible, but nothing happens when I perform the click. Also, there are no errors in the Logcat. The XML

Android – programmatically change the state of a switch without triggering OnCheckChanged listener

I’m looking for a method of programmatically changing the state of an Android Switch widget using switch.setChecked(true); without triggering OnCheckedChangedlistener. My first thought was to swap it out for an OnClickListener but as this only registers clicks and you are able to not only click but also slide a Switch then it’s not really fit for purpose as if the

Advertisement