Are you actually checking the tag value? Or are you simply relaying on your “switch(tag)” block for it? Because without “break” statements, it will always do the “default”, as it will “fall” to it.
case 1 : someFun();
case 2 : someFun(); break;
If the value is other than 1 or 2, someFun() will be called once (from the default block - `break` here is not needed as it is the lastt block). If the value is 2, someFun() will also be called only once, because there is a `break`. But if the value is 1, someFun() will be called twice, because it will enter the `case 1:` block, and after returning from someFun() it will “fall” to `case 2:` block, because there was no `break` in `case 1:` block.
So if you were to add breaks to your case 111 and case 222 you won’t get error logs for this tag values.
Side note, as I don’t know much about MenuItemToggle - are you sure that it is not the sender?