title: unable to get selected spinner value when assign values from strings.xml in android application
body: <p>In <code>android application</code> to <code>populate values</code> into <code>spinner</code> I have <code>used values from  values\strings.xml</code></p>
  
  <pre><code> &lt;string-array name="myList"&gt;
         &lt;item&gt;first&lt;/item&gt;
          &lt;item&gt;second&lt;/item&gt;
    &lt;/string-array&gt;
  </code></pre>
  
  <p>In <code>layout\input_box.xml</code></p>
  
  <pre><code> &lt;Spinner
          android:id="@+id/spinner_problems"
          android:entries="@array/myList"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"       
           /&gt;
  </code></pre>
  
  <p>above code will <code>populate spinner values from myList</code></p>
  
  <p>on <code>MainActivity.java</code></p>
  
  <pre><code>@Override
      protected void onCreate(Bundle savedInstanceState) {
  
    spin_problem = (Spinner)findViewById((R.id.spinner_problems));   
          spin_problem.setOnItemSelectedListener(new OnItemSelectedListener(){
  
               @Override
               public void onItemSelected(AdapterView&lt;?&gt; adapter, View view1, int pos, long id)
               {
                    spin_problem_val= adapter.getItemAtPosition(pos).toString();
               }
  
              @Override
              public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
                  // TODO Auto-generated method stub
  
              }
          });
  
      //thread run
          Handler handler = new Handler();
          handler.postDelayed(new Runnable() {
              public void run() {
                  try {
                      showInputDialog("Any Complaints?");
                  } catch (JSONException e) {
                      e.printStackTrace();
                  }
              }}, 8000);  // 3000 milliseconds
          //end thread        
  
  }
  </code></pre>
  
  <p>showInputDailog method code
  // my textbox and spinner is in this method</p>
  
  <pre><code>public void showInputDialog(final String textparam) throws JSONException {      
           try{
          // get prompts.xml view to show complaint popup 
          LayoutInflater layoutInflater = LayoutInflater.from(MainActivity.this);
          View promptView = layoutInflater.inflate(R.layout.input_dialog, null);
          AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
                  MainActivity.this);
          alertDialogBuilder.setView(promptView);
           if(textparam.toString() == "Feedback"){alertDialogBuilder.setTitle("Feedback");}
           else{alertDialogBuilder.setTitle("Any Complaints?");}
  
          //Get all dialog box values
          final EditText name = (EditText) promptView
                  .findViewById(R.id.name);
          final EditText mobno = (EditText) promptView
                  .findViewById(R.id.mobno);
          final EditText complaint = (EditText) promptView
                  .findViewById(R.id.complaint);
  
  
  
          // final Spinner problems = (Spinner)findViewById((R.id.spinner_problems));     
          // final Spinner area = (Spinner)findViewById((R.id.spinner_area));
  
      //  final String aa = problems.getSelectedItem().toString();
       // final String vvv = area.getSelectedItem().toString();   
  </code></pre>
  
  <p>//HERE I need to get spinner value to process further... 
  }</p>