title: Spinner subitem
body: <p>I want to populate a Spinner with items which have a main text and a sub text, just like Android Studio shows when building the view on the "Designer" tab.</p>
  
  <p><img src="https://i.stack.imgur.com/ALJ1p.jpg" alt="example"></p>
  
  <p>So far I was able to fill it with the main text only.</p>
  
  <p>I am doing it via code. Using a SimpleAdapter.</p>
  
  <p>I tried the following but with no success, it just gives me same result (only main text):</p>
  
  <pre><code>    Spinner spinner = (Spinner) findViewById(R.id.mySpinner);
  
      List&lt;Map&lt;String, String&gt;&gt; itens = new ArrayList&lt;&gt;();
  
      Map&lt;String, String&gt; item = new HashMap&lt;&gt;(2);
      item.put("text", "MAIN TEXT");
      item.put("subText", "SUB TEXT");
      itens.add(item);
  
      SimpleAdapter adapter = new SimpleAdapter(spinner.getContext(), itens,
              android.R.layout.simple_spinner_dropdown_item,
              new String[]{"text", "subText"},
              new int[]{android.R.id.text1, android.R.id.text2}
      );
  
      // i am not sure what this does
      adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  
      spinner.setAdapter(adapter);
  </code></pre>