Search code examples
androidandroid-actionbaractionbarsherlock

Navigation Icon no longer firing SlidingMenu after implementing ActionBarSherlock


When first experimenting with the SlidingMenu library by jfeinstein10, in the example project, clicking the icon button in the action bar would cause the sliding menu to open and then close when clicked again. After implementing ActionBarSherlock and getting it to run (not throwing any errors), the icon no longer causes the menu to appear. So far I have changed the SlidingMenu library to extend SherlockActivity instead of extending android Activity as suggested in the SlidingMenu read me. I have also changed the following lines in BaseActivity:

Original:

// customize the ActionBar
    if (Build.VERSION.SDK_INT >= 11) {
        getActionBar().setDisplayHomeAsUpEnabled(true);
    }

Changed to:

// customize the ActionBar
   getSupportActionBar().setDisplayHomeAsUpEnabled(true);

It seems as if the button press is being registered in LogCat, but it's not doing anything.

I've been trying to figure this out for a while now and just wanted to see if anyone has experienced this issue or is familiar enough with both/either libraries to quickly help pinpoint where I'm going wrong or what I forgot to do.

Thanks!


Solution

  • this is your problem

    import android.view.MenuItem
    

    you must use Shearlock Menu not android Menu.

    remove android MenuItem import and use Shearlock one`s

    import com.actionbarsherlock.view.MenuItem;
    import com.actionbarsherlock.view.Menu;