I am trying to use a sliding menu in my existing project where action bar Sherlock is used. But I am unable to do that. If you can give me a simple demo or tutorial to show me how to do so, that would be great? Do we have to use the fragments for the sliding menu?
Update:
How do I change the Activity when the user clicks on an item of the Sliding Menu list?
Is there a demo? please help.
Edit library SliderMenu
to extents SherlockActivity
public class SlidingActivity extends SherlockActivity implements SlidingActivityBase {
Do as it says in https://github.com/jfeinstein10/SlidingMenu
In onCreate:
setBehindContentView(R.layout.slide_menu);
getSlidingMenu().setShadowWidthRes(R.dimen.shadow_width);
getSlidingMenu().setShadowDrawable(R.drawable.shadow);
getSlidingMenu().setBehindOffsetRes(R.dimen.actionbar_home_width);
getSlidingMenu().setBehindScrollScale(0.25f);
And in the activity:
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
toggle();
return true;
}
return super.onOptionsItemSelected(item);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With