Hi I am developing an Android application. In my application I am using Sherlock action. I\'ve defined few menu items in action-bar like in following manner
<
Try this code in your activity.
Be sure to properly set your
R.menu.menuidentifier
R.id.menuitemidentifier
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.actionbarhelpmenu, menu);
final Menu m = menu;
final MenuItem item = menu.findItem(R.id.ActionConnection);
item.getActionView().setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
m.performIdentifierAction(item.getItemId(), 0);
}
});
return true;
}