空闲时间,学习点东西给自己补补营养!
SubMenu subMenuGender = menu.addSubMenu(MAIN_GROUP,MENU_GENDER,0,R.string.gender);
subMenuGender.setIcon(R.drawable.gender);
subMenuGender.setHeaderIcon(R.drawable.gender);
male=subMenuGender.add(GENDER_GROUP, MENU_GENDER_MALE, 0, R.string.male);
male.setChecked(true);
subMenuGender.add(GENDER_GROUP, MENU_GENDER_FEMALE, 0, R.string.female);
//设置GENDER_GROUP组是可选择的,互斥的
subMenuGender.setGroupCheckable(GENDER_GROUP, true,true);