Overriding onOptionsItemSelected

219 views
Skip to first unread message

Ronnie Trøjborg

unread,
Jun 5, 2012, 9:14:55 AM6/5/12
to actionba...@googlegroups.com
I've been trying to implement a "facebook" menu(you press a button on the top left corner and the menu slides in from the left) which requires me to override onOptionsItemSelected. This works just fine when I override the method of Activity and FragmentActivity, but if I do it on SherlockFragmentActivity nothing happens.

@Override
public boolean onOptionsItemSelected(MenuItem item) 
{
    int id = item.getItemId();
    if (id == android.R.id.home) {
        rbmView.toggleMenu();
    return true;
    }else {
        return super.onOptionsItemSelected(item);
    }
}


Is this even possible using the SherlockActionBar without using functionality?

Prakash Nadar

unread,
Jun 5, 2012, 9:50:11 AM6/5/12
to actionba...@googlegroups.com
Make sure that MenuItem is from sherlock namespace and not from android

-prakash

Reply all
Reply to author
Forward
0 new messages