How to track the Share button clicked on the ActionBar?
问题 I have added Share option to my ActionBarSherlock, this way: public boolean onCreateOptionsMenu(final Menu menu) { menu.add("Share") .setIcon(R.drawable.ic_title_share_default) .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT); } and on clicking this Icon i want to do something. how can i track the click on this ShareIcon?? 回答1: You should create an XML file to define menu items. For example mymenu.xml <?xml version="1.0" encoding="utf-8"?> <menu xmlns