title: How to set onClick listener on navigation drawer
body: <p>Its in <strong>SlidingMenuFragment.java</strong> and I want each item listed clickable. Please help to achieve this.</p>
  
  <p>DRAWER ITEMS</p>
  
  <p>I want this 3 clickable so that I can open a new activity.</p>
  
  <pre><code>data.add("One");
  data.add("Two");
  data.add("Three");
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/f3GmV.png" rel="nofollow">navigation drawer items</a></p>
  
  <p>Thank you for helping.
  The code below is from <a href="http://manishkpr.webheavens.com/android-material-design-navigation-drawer-example/" rel="nofollow">http://manishkpr.webheavens.com/android-material-design-navigation-drawer-example/</a></p>
  
  <pre><code>package com.manishkpr.androidmaterialnavigationdrawer;
  
  import java.util.ArrayList;
  import java.util.List;
  
  import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ListView;
  import android.widget.*;
  
  public class SlidingMenuFragment extends Fragment {
  List&lt;String&gt;data;
  ListView list_view;
  SlidingMenuListAdapter adapter;
  
  public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
      ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_sliding_menu, null);
      setUpView(root);
      return root;
  }
  void setUpView(ViewGroup root){
      list_view  =  (ListView)root.findViewById(R.id.list_view);
      initList();
      setUpClick();
  }
  void initList(){
      data = new ArrayList&lt;String&gt;();
  
      data.add("One");
      data.add("Two");
      data.add("Three");
  
      adapter = new SlidingMenuListAdapter(getActivity(),data);
      list_view.setAdapter(adapter);
  }
  void setUpClick(){
      list_view.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                  @Override
                  public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
                  MainActivity.obj.closeDrawer();
                  Toast.makeText(getActivity(),"Hi "+position,Toast.LENGTH_SHORT).show();
              }
          });
  }
  }
  </code></pre>