title: Unchecked cast spinnerAdapter to arrayAdapter<String> warning
body: <p>I need to set the selected item on a spinner using the value of a String.
  At the moment I use this (hint found here: <a href="https://stackoverflow.com/questions/11072576/set-selected-item-of-spinner-programmatically">Set selected item of spinner programmatically</a>).</p>
  
  <pre><code>Spinner nudSpinner = (Spinner)nud.findViewById(R.id.spinUnity);
  EditText nudEText = (EditText)nud. findViewById(R.id.etxtUnityName);
  nudSpinner.setSelection(((ArrayAdapter&lt;String&gt;)nudSpinner.getAdapter()).getPosition(unities.get(position).split(" ")[0]));
  </code></pre>
  
  <p>It works fine but it gives me the following warning:</p>
  
  <pre><code>Unchecked cast: 'android.widget.SpinnerAdapter' to 'android.widget.ArrayAdapter&lt;java.lang.String&gt;'
  Signals places where an unchecked warning is issued by the compiler, for example:
  
    void f(HashMap map) {
      map.put("key", "value");
    }
  
  Hint: Pass -Xlint:unchecked to javac to get more details.
  </code></pre>
  
  <p>How can I solve the warning?</p>
  
  <p>Thanks</p>