title: Navigation drawer : changing layouts using fragment and adding listeners
body: <p>I'm trying to add the new Navigation drawer to my app and instead of changing images(as they are shown in the google example) I manage to change layouts inside the fragment.</p>
  
  <p>The problem is that after changing a layout I don't have any access to the buttons and other objects inside the layout.</p>
  
  <p>How can I get access to the buttons and other objects that are shown in the current 
  inflatered layout, and set listeners?</p>
  
  <pre><code>@Override 
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
  { 
  switch(pageNum)
  { 
  case 0: rootView = inflater.inflate(R.layout.groups_layout, container, false);
  break;
  case 1: rootView = inflater.inflate(R.layout.schedule_layout, container, false);
  break; 
  case 2: rootView = inflater.inflate(R.layout.courses_layout, container, false);
  break;
  } 
    theView = rootView; 
    return rootView; 
   } 
  }
  </code></pre>
  
  <p>Thanks in advance.</p>