title: Select Item in Spinner - Android
body: <p>I have an item with id and value and I want to add them into a spinner.
  So when I select the item, I will get the id of it. I can only add itemValue as below and get the selected String.</p>
  
  <p>Can anyone give me the solution for this?</p>
  
  <pre><code>List&lt;String&gt; list = new ArrayList&lt;String&gt;();
                  list.add("item 1");
                  list.add("item 2");
                  list.add("item 3");
                  ArrayAdapter&lt;String&gt; dataAdapter = new ArrayAdapter&lt;String&gt;(
                          this, android.R.layout.simple_spinner_item, list);
                  dataAdapter
                          .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                  final Spinner sp = new Spinner(this);
                  sp.setAdapter(dataAdapter);
  </code></pre>