title: AndroidStudio - NavigationDrawer and CustomAdapter
body: <p>I have created a new project using <code>AndroidStudio</code> and I have included the <code>NavigationDrawer</code> that comes from with the IDE.<br>
  I would like to modify the <code>Navigation</code> that comes from the left side and add two <code>TextView</code>, one will hold the menu text and the second will hold just a letter right now.</p>
  
  <p>So I have create a class to manage my custom menu:</p>
  
  <pre><code>public class MioMenu{
      private String voce;
      private String immagine;
  
      public MioMenu(String immagine, String voce){
          this.immagine = immagine;
          this.voce = voce;
      }
  
      public String getVoce(){
          return this.voce;
      }
  
      public String getImmagine(){
          return this.immagine;
      }
  }
  </code></pre>
  
  <p>Then I have created my <code>CustomAdapter</code> and override the <code>getView</code> method:</p>
  
  <pre><code>import android.content.Context;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ArrayAdapter;
  import android.widget.TextView;
  
  public class MioMenuAdapter extends ArrayAdapter&lt;MioMenu&gt;{
  
      public MioMenuAdapter(Context context, int textViewResourceId, MioMenu[] objects){
          super(context, textViewResourceId, objects);
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent){
          LayoutInflater inflater = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          convertView = inflater.inflate(R.layout.custom_row_menu_laterale, null);
          TextView icona = (TextView)convertView.findViewById(R.id.iconaCustom);
          TextView testo = (TextView)convertView.findViewById(R.id.testoCustom);
  
          MioMenu mm = getItem(position);
          icona.setText(mm.getImmagine());
          testo.setText(mm.getVoce());
  
          return convertView;
      }
  }
  </code></pre>
  
  <p>And this is my custom_layout:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
  
      &lt;TextView
          android:id="@+id/iconaCustom"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text=""
          android:textColor="#00AA00"
          /&gt;
  
      &lt;TextView
          android:id="@+id/testoCustom"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text=""
          android:textColor="#00AA00"
          /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Now I have edited the <code>onCreateView</code> in the <code>NavigationDrawerFragment.java</code> created by default with the IDE:</p>
  
  <pre><code> @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
          mDrawerListView = (ListView) inflater.inflate(
                  R.layout.fragment_navigation_drawer, container, false);
          mDrawerListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
              @Override
              public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
                  selectItem(position);
              }
          });
  
          //Creo una nuova lista che conterrà i miei dati per generare il menu
          List list = new LinkedList();
  
          //Creo le voci
          list.add(new MioMenu("a", getString(R.string.title_section1)));
          list.add(new MioMenu("b", getString(R.string.title_section2)));
          list.add(new MioMenu("c", getString(R.string.title_section3)));
          list.add(new MioMenu("d", getString(R.string.title_section4)));
          list.add(new MioMenu("e", getString(R.string.title_section5)));
          list.add(new MioMenu("f", getString(R.string.title_section6)));
  
          /*mDrawerListView.setAdapter(new ArrayAdapter&lt;String&gt;(
                  getActionBar().getThemedContext(),
                  android.R.layout.simple_list_item_2,
                  android.R.id.text1,
                  //Elenco voci del menu laterale
                  new String[]{
                          getString(R.string.title_section1),
                          getString(R.string.title_section2),
                          getString(R.string.title_section3),
                          getString(R.string.title_section4),
                          getString(R.string.title_section5),
                          getString(R.string.title_section6),
                  }));
             */
  
          MioMenuAdapter mio_adapter = new MioMenuAdapter(getActivity(), R.layout.custom_row_menu_laterale, list);
          mDrawerListView.setAdapter(mio_adapter);
  
          mDrawerListView.setItemChecked(mCurrentSelectedPosition, true);
          return mDrawerListView;
      }
  </code></pre>
  
  <p>As you can see I have commented out the <code>setAdapter</code> and I have create a <code>List</code> to save my custom object and then pass it to my custom adapter but the IDE stops me with a red line under</p>
  
  <pre><code>MioMenuAdapter mio_adapter = new MioMenuAdapter(getActivity(), R.layout.custom_row_menu_laterale, list);
  </code></pre>
  
  <p>With this error:</p>
  
  <p><img src="https://i.stack.imgur.com/4EKCv.png" alt="enter image description here"></p>
  
  <p>I have no idea what I am doing wrong here</p>