title: setOnItemClickListener Not launching Activity in Navigation Drawer
body: <p>I am following this tutorial to Implement Navigation Drawer.
  <a href="http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/" rel="nofollow noreferrer">http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/</a></p>
  
  <p>I am able to set the title in the ActionBar but it is <strong>not launching the activity.</strong></p>
  
  <p>I have reffered to:- <a href="https://stackoverflow.com/questions/26271249/setonitemclicklistener-in-navigation-drawer-not-working">setOnItemClickListener() in navigation drawer not working?</a>
  , <a href="https://stackoverflow.com/questions/29022049/navigation-drawer-setonitemclicklistener-not-working">Navigation Drawer setOnItemClickListener not working</a> and many other links.</p>
  
  <p>This is my xml where navigation drawer is and it is also my <code>activity_main</code>.</p>
  
  <pre><code>&lt;android.support.v4.widget.DrawerLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;FrameLayout
          android:id="@+id/frame_container"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
  
      &lt;!-- Listview to display slider menu --&gt;
      &lt;ListView
          android:id="@+id/list_slidermenu"
          android:layout_width="240dp"
          android:layout_height="match_parent"
          android:layout_gravity="start"
          android:choiceMode="singleChoice"
  
          android:divider="@color/list_divider"
          android:dividerHeight="1dp"
          android:listSelector="@drawable/list_selector"
          android:background="@color/list_background"/&gt;
  
  &lt;android.support.design.widget.CoordinatorLayout
      android:id="@+id/coordinatorLayout"
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
  
      android:layout_height="match_parent"
      tools:context=".MainActivity"&gt;
  
  &lt;RelativeLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      xmlns:fbutton="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      xmlns:card_view="http://schemas.android.com/apk/res-auto"
      android:layout_height="wrap_content"
      android:paddingLeft="16dp"
      android:paddingRight="16dp"
      android:paddingTop="16dp"
      android:paddingBottom="16dp"
      tools:context=".MainActivity"&gt;
  
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:id="@+id/LL1"&gt;
  
          &lt;Spinner
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:id="@+id/spinner1"
              android:layout_weight="0.5"
              android:spinnerMode="dropdown" /&gt;
  
          &lt;Spinner
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:id="@+id/spinner2"
              android:layout_weight="0.5" /&gt;
  
      &lt;/LinearLayout&gt;
  
  
      &lt;LinearLayout
          android:layout_below="@+id/LL1"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:id="@+id/LL2"&gt;
  
          &lt;EditText
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:inputType="number"
              android:ems="10"
              android:ellipsize="start"
              android:gravity="center_horizontal"
              android:id="@+id/Amount"
              android:hint="Enter your Budget" /&gt;
      &lt;/LinearLayout&gt;
  
  
      &lt;RelativeLayout
          android:id="@+id/LLR3"
          android:layout_below="@+id/LL2"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"&gt;
          &lt;LinearLayout
              android:weightSum="1"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:id="@+id/LL3"&gt;
  
              &lt;info.hoang8f.widget.FButton
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_weight="0.5"
                  android:layout_marginRight="2dp"
                  android:text="More Talktime less Validity"
                  android:id="@+id/Calculate"
                  fbutton:buttonColor="@color/fbutton_color_peter_river"
                  fbutton:shadowColor="@color/fbutton_color_belize_hole"
                  fbutton:shadowEnabled="true"
                  fbutton:shadowHeight="5dp"
                  fbutton:cornerRadius="5dp"
                  android:layout_alignParentTop="true"
                  android:layout_alignParentRight="true"
                  android:layout_alignParentEnd="true" /&gt;
  
              &lt;info.hoang8f.widget.FButton
                  android:layout_marginLeft="2dp"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_weight="0.5"
                  android:text="More Validity less talktime"
                  android:id="@+id/Calculate2"
                  fbutton:buttonColor="@color/fbutton_color_pumpkin"
                  fbutton:shadowColor="@color/fbutton_color_pomegranate"
                  fbutton:shadowEnabled="true"
                  fbutton:shadowHeight="5dp"
                  fbutton:cornerRadius="5dp"
                  android:layout_alignParentTop="true"
                  android:layout_alignParentLeft="true"
                  android:layout_alignParentStart="true"
                  android:layout_toLeftOf="@+id/Calculate"
                  android:layout_toStartOf="@+id/Calculate" /&gt;
  
          &lt;/LinearLayout&gt;
      &lt;/RelativeLayout&gt;
  
      &lt;android.support.v7.widget.CardView
          android:id="@+id/card_view"
          android:layout_gravity="center"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          card_view:cardElevation="10dp"
          card_view:cardCornerRadius="4dp"
          card_view:contentPadding="10dp"
          android:layout_marginLeft="5dp"
          android:layout_marginTop="5dp"
          android:layout_marginRight="5dp"
          android:layout_above="@+id/connect"
          android:layout_below="@+id/LLR3"&gt;
  
          &lt;ListView
              android:id="@+id/listview"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:layout_above="@+id/res"
              android:layout_below="@+id/LLR3" /&gt;
          &lt;com.top.up.planner.MyTextViewNormal
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:gravity="center"
              android:layout_below="@+id/listview"
              android:id="@+id/res"
              android:layout_centerHorizontal="true"
              android:layout_alignParentBottom="true"/&gt;
  
      &lt;/android.support.v7.widget.CardView&gt;
      &lt;com.top.up.planner.MyTextViewNormal
          android:layout_width="fill_parent"
          android:textSize="18dp"
          android:layout_height="wrap_content"
          android:gravity="center"
          android:id="@+id/connect"
          android:layout_centerHorizontal="true"
          android:layout_alignParentBottom="true"/&gt;
  
  &lt;/RelativeLayout&gt;
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
      &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>My java code:-</p>
  
  <pre><code>         private DrawerLayout mDrawerLayout;
      private ListView mDrawerList;
      private ActionBarDrawerToggle mDrawerToggle;
  
      // nav drawer title
      private CharSequence mDrawerTitle;
  
      // used to store app title
      private CharSequence mTitle;
  
      // slide menu items
      private String[] navMenuTitles;
      private TypedArray navMenuIcons;
  
      private ArrayList&lt;NavDrawerItem&gt; navDrawerItems;
      private NavDrawerListAdapter Navadapter;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
            mTitle = mDrawerTitle = getTitle();
          // load slide menu items
          navMenuTitles = getResources().getStringArray(R.array.nav_drawer_items);
          // nav drawer icons from resources
          navMenuIcons = getResources()
                  .obtainTypedArray(R.array.nav_drawer_icons);
  
          mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
          mDrawerList = (ListView) findViewById(R.id.list_slidermenu);
  
          navDrawerItems = new ArrayList&lt;NavDrawerItem&gt;();
  
          // adding nav drawer items to array
          // Home
          navDrawerItems.add(new NavDrawerItem(navMenuTitles[0], navMenuIcons.getResourceId(0, -1)));
          // Find People
          navDrawerItems.add(new NavDrawerItem(navMenuTitles[1], navMenuIcons.getResourceId(1, -1)));
  
          // Recycle the typed array
          navMenuIcons.recycle();
          mDrawerList.bringToFront();
          mDrawerLayout.requestLayout();
          mDrawerList.setOnItemClickListener(new SlideMenuClickListener());
  
          Navadapter = new NavDrawerListAdapter(getApplicationContext(), navDrawerItems);
          mDrawerList.setAdapter(Navadapter);
  
  
          // enabling action bar app icon and behaving it as toggle button
          getSupportActionBar().setDisplayHomeAsUpEnabled(true);
          getSupportActionBar().setHomeButtonEnabled(true);
  
          mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
                  R.mipmap.ic_drawer, //nav menu toggle icon
                  R.string.app_name, // nav drawer open - description for accessibility
                  R.string.app_name // nav drawer close - description for accessibility
          ) {
              public void onDrawerClosed(View view) {
                  getSupportActionBar().setTitle(mTitle);
                  // calling onPrepareOptionsMenu() to show action bar icons
                  invalidateOptionsMenu();
              }
  
              public void onDrawerOpened(View drawerView) {
                  getSupportActionBar().setTitle(mDrawerTitle);
                  // calling onPrepareOptionsMenu() to hide action bar icons
                  invalidateOptionsMenu();
              }
          };
          mDrawerLayout.setDrawerListener(mDrawerToggle);
  
          if (savedInstanceState == null) {
              // on first time display view for first nav item
              displayView(0);
          }
  
  public class SlideMenuClickListener implements ListView.OnItemClickListener {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
              // display view for selected nav drawer item
              displayView(position);
          }
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          getMenuInflater().inflate(R.menu.menu_main, menu);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          super.onOptionsItemSelected(item);
          if (mDrawerToggle.onOptionsItemSelected(item)) {
              return true;
          }
          switch(item.getItemId())
          {
  
              case R.id.item1:
                  OnShare();
                  return true;
              case R.id.item2:
                  Intent intent = new Intent(getApplicationContext(),Help.class);
                  startActivity(intent);
                  return true;
              default:
                  return super.onOptionsItemSelected(item);
  
          }
  
      }
  
      @Override
      public boolean onPrepareOptionsMenu(Menu menu) {
          // if nav drawer is opened, hide the action items
          boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList);
          //menu.findItem(R.id.action_settings).setVisible(!drawerOpen);
          return super.onPrepareOptionsMenu(menu);
      }
  
      private void displayView(int position) {
          // update the main content by replacing fragments
          Fragment fragment = null;
          switch (position) {
              case 0:
                  fragment = new HomeFragment();
                  break;
              case 1:
                  fragment = new FindPeopleFragment();
                  break;
              default:
                  break;
          }
  
          if (fragment != null) {
              FragmentManager fragmentManager = getFragmentManager();
              fragmentManager.beginTransaction()
                      .replace(R.id.frame_container, fragment).commit();
  
              // update selected item and title, then close the drawer
              mDrawerList.setItemChecked(position, true);
              mDrawerList.setSelection(position);
              setTitle(navMenuTitles[position]);
              mDrawerLayout.closeDrawer(mDrawerList);
          } else {
              // error in creating fragment
              Log.e("MainActivity", "Error in creating fragment");
          }
      }
  
  
  
      @Override
      public void setTitle(CharSequence title) {
          mTitle = title;
          getSupportActionBar().setTitle(mTitle);
      }
  
      /**
       * When using the ActionBarDrawerToggle, you must call it during
       * onPostCreate() and onConfigurationChanged()...
       */
  
      @Override
      protected void onPostCreate(Bundle savedInstanceState) {
          super.onPostCreate(savedInstanceState);
          // Sync the toggle state after onRestoreInstanceState has occurred.
          mDrawerToggle.syncState();
      }
  
      @Override
      public void onConfigurationChanged(android.content.res.Configuration newConfig) {
          super.onConfigurationChanged(newConfig);
          // Pass any configuration change to the drawer toggls
          mDrawerToggle.onConfigurationChanged(newConfig);
      }
  </code></pre>
  
  <p>And the drawble is being set to a Back arrow, but i have coded it show hamburger icon how to fix that ?</p>