Finding items in a group [android] -


when click menu item want able un-check other items contained in same group can create radiobutton effect. object need cast item.getgroupid() to- able siblings , uncheck them? here code

    int groupid = item.getgroupid();      if (item.ischecked() == false) {         item.seticon(android.r.drawable.checkbox_off_background);         item.setchecked(true);     } else {         item.seticon(android.r.drawable.checkbox_off_background);         item.setchecked(false);     } 

here xml general structure

<menu> <group id = "mygroup" <item/> </group> </menu> 

thanks lot. if knows how make icon begin on right instead of left of each item awesome, im new android , lot

in xml menu, set group attribute android:checkablebehavior single described in documentation.


Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -