title: OnListItemClick to open a new Fragment
body: <p>I'm using "Action bar Sherlock" and "SlidingMenu" libraries.
  I have a List of 5 items, I want to change fragments on clicking an item from the list.
  Here's my code so far, I'm trying to use OnListItemClick but I don't really know how to use it.</p>
  
  <pre><code>public class RandomList extends SherlockListFragment {
  
      String[] list_contents = {"Page 1", "Page 2", "Page 3", "Page 4", "Page 5" };
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          // return super.onCreateView(inflater, container, savedInstanceState);
          return inflater.inflate(R.layout.list, container, false);
      }
  
      @Override
      public void onActivityCreated(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          super.onActivityCreated(savedInstanceState);
          setListAdapter(new ArrayAdapter&lt;String&gt;(getActivity(),
                         android.R.layout.simple_list_item_1, list_contents));
      }
  
      @Override
      public void onListItemClick(ListView l, View v, int position, long id) {
          // TODO Auto-generated method stub
          super.onListItemClick(l, v, position, id);
  
          // **Open different fragment after click**
      }
  }
  </code></pre>