title: Android: navigation drawer with custom adapter onItemClickListener
body: <p>I've been trying set custom ListView adapter for navigation drawer it derived from <code>BaseAdapter</code> so when I set <code>OnItemClickListener</code> it doesn't work on either <code>ListView.OnItemClickListener</code> and <code>AdapterView.OnItemClickListener</code>.</p>
  
  <p>Googled around but all examples derive from <code>ArrayAdapter</code> since <code>BaseAdapter</code> desired.
  Can anyone help me on this?</p>
  
  <h2>NavigationDrawer fragment onCreateView</h2>
  
  <pre><code>drawerItems = new ArrayList&lt;DrawerItem&gt;();
  drawerItems.add(DrawerItem.create(1, getString(R.string.ideas), getDrawable(R.drawable.ic_action_diamond)));
  drawerItems.add(DrawerItem.create(2, getString(R.string.categories), getDrawable(R.drawable.ic_action_categories)));
  drawerItems.add(DrawerItem.create(3, getString(R.string.priorities), getDrawable(R.drawable.ic_action_priorities)));
  
  mDrawerListAdapter = MenuAdapter.newInstance(getActivity(), drawerItems);
  mDrawerListView.setItemsCanFocus(true);
  
  mDrawerListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
      @Override
      public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
          Log.d(TAG, String.valueOf(position));
                  selectItem(position);
      }
  });
  
  mDrawerListView.setAdapter(mDrawerListAdapter);
  mDrawerListView.setItemChecked(mCurrentSelectedPosition, true);
  </code></pre>
  
  <h2>My custom adapter</h2>
  
  <pre><code>public class MenuAdapter extends BaseAdapter {
      private static final String TAG = "AD:MENU";
  
      private final LayoutInflater mLayoutInflater;
      private List&lt;DrawerItem&gt; items;
      private Context context;
  
      public MenuAdapter(Context ctx, List&lt;DrawerItem&gt; items) {
          this.items = items;
          this.context = ctx;
          this.mLayoutInflater = LayoutInflater.from(ctx);
      }
  
      public static MenuAdapter newInstance(Context ctx, List&lt;DrawerItem&gt; items) {
          return new MenuAdapter(ctx, items);
      }
  
      @Override
      public int getCount() {
          return items == null ? 0 : items.size();
      }
  
      @Override
      public Object getItem(int position) {
          return items.get(position);
      }
  
      @Override
      public long getItemId(int position) {
          return position;
      }
  
      @Override
      public View getView(int position, View v, ViewGroup parent) {
          DrawerItem item = (DrawerItem) getItem(position);
          ViewHolder holder;
  
          if (v == null) {
              v = mLayoutInflater.inflate(R.layout.drawable_item, parent, false);
              holder = new ViewHolder();
  
              if (v != null) {
                  holder.title = (TextView) v.findViewById(R.id.menu_title);
  
                  holder.title.setTag(item.id);
                  v.setTag(holder);
              }
          } else {
              holder = (ViewHolder) v.getTag();
          }
  
          holder.title.setText(item.title);
          holder.title.setCompoundDrawablesWithIntrinsicBounds(item.icon, null, null, null);
  
          Log.d(TAG, item.title);
  
          return v;
      }
  
      public class ViewHolder {
          TextView title;
      }
  
  }
  </code></pre>