title: How to open navigation drawer on button click in main fragment?
body: <p>I have made an app with one activity which uses a navigation drawer to open a number of different fragments. I have the actionbar drawertoggle, but it is not very visible.
  If I place a button in the onCreateView in my main fragment(the fragment that appears when my app first starts up), how can I get it to open the navigation drawer controlled by my activity?</p>
  
  <hr>
  
  <p>This seems to work. The answer is much simpler than I thought it would be.</p>
  
  <pre><code>@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
      View fragView = inflater.inflate(R.layout.mainmenu, container, false);
      button1 = (Button) fragView.findViewById(R.id.button1);         
      mDrawerLayout = (DrawerLayout)getActivity().findViewById(R.id.drawer_layout);
      mDrawerList = (ListView)getActivity().findViewById(R.id.left_drawer);
      button1.setOnClickListener(this);
      return fragView;
  }
  
  
  @Override
  public void onClick(View v) {       
  
          mDrawerLayout.openDrawer(mDrawerList);          
  
      }
  </code></pre>
  
  <p>Thank you for your answers.</p>