Today when modifying a problem, the use of the Activitychooserview class, however, this class will automatically display two buttons, one is clicked with a drop-down box, one is selected after the application, the Display app icon. Because the app icon doesn't match the environment at the time, try to get rid of the icon. It's really simple, just a way to do it, as shown below
MenuItem SendItem =Menu.finditem (r.id.action_send); MenuItem Shareitem=Menu.finditem (R.id.action_share); if(Mappbridge! =NULL) { if(Shareitem! =NULL) {shareitem.setvisible (cansharebyhotknot); ((Activitychooserview) Shareitem.getactionview ()). setrecentbuttonenabled (false); } if(SendItem! =NULL) {senditem.setvisible (false); } } Else { if(Shareitem! =NULL) {shareitem.setvisible (false); } }
This method
( (Activitychooserview) Shareitem.getactionview ()) . setrecentbuttonenabled (false);
is to control the application display button
activitychooserview-How to hide the selected app icon