title: Sliding menu toggle option
body: <p>I want to use the menu button on  android to make the sliding menu toggle from left to right. The problem I face is that since I have used the sliding menu functionality in my main activity on create method, I do not how to use the same variable in the onPrepareOptionMenu method. </p>
  
  <pre><code>SlidingMenu menu;
      menu = new SlidingMenu(this);
      menu.setMode(SlidingMenu.LEFT);
      menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN);
      menu.setShadowWidth(10);
      menu.setBehindOffset(60);
      menu.setFadeDegree(0.25f);
      menu.attachToActivity(this, SlidingMenu.SLIDING_WINDOW);
      menu.setBehindWidth(400);
      menu.setMenu(R.layout.menu_frame);
  </code></pre>
  
  <p>this is the code which I use to call the sliding menu, However, I want to enable the toggle button whenever the menu button is called along side the swipe gesture .</p>
  
  <pre><code>public boolean onPrepareOptionsMenu(Menu menu) {
      MenuInflater inflater = getMenuInflater();
      inflater.inflate(R.menu.activity_main, menu);
      //try to enable the toggle here so that the sliding menu can appear/disappear
      return true;
  }
  </code></pre>
  
  <p>The problem is that unlike most cases, I do not extend my main class with the Sherlock activity since my main class is already extending some other activity. Hence I use the sliding menu in form of a constructor(look at my example). I am not sure how to integrate the toggle function. Thank for all the help</p>