title: Setting a custom object to a Spinner and showing a specific property
body: <p>I have a spinner which I need to populate with String values, but also I need to conserve the id of that String.</p>
  
  <p>I have this strucuture to show in the spinner</p>
  
  <pre><code>public class Item{
  
      private Integer id;
  
      private Double name;
  }
  </code></pre>
  
  <p>I want to show the name in the spinner but when I select one item and press a button, i want to have the id of that name.</p>
  
  <p>The String doesn't repite, so I can do a <code>Map&lt;Integer, String&gt;</code> to manange this, but I'm wondering if exists a better solution to this, like customing the adapter or the layout of the spinner or setting a sort of Data Source Object for the spinner and show a specific property of the object.</p>
  
  <p>This is my spinner_layout.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/spinnerTarget"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:textSize="12pt"
      android:gravity="center"/&gt;
  </code></pre>