title: getting "unfortunately has stopped" error when using resources
body: <p>I think I don't need to tell what I try to but I want to tell. There is 2 <code>&lt;string-array&gt;</code> first is for <code>android:entries</code> second for values of these entries. When user selects the item I want to get value of that item. </p>
  
  <p><strong>Also I want to ask, When application is opened, dialog run. I want to make it run just when after user select an item.</strong></p>
  
  <pre><code>public class Select extends Activity implements OnItemSelectedListener{
  
      Resources rsc = getResources();
      @SuppressLint("Recycle")
      final TypedArray itemValues = rsc.obtainTypedArray(R.array.selectValues);
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          super.onCreate(savedInstanceState);
          setContentView(R.layout.select);
  
          Spinner form = (Spinner) findViewById(R.id.sSelect);
          form.setOnItemSelectedListener(this);
      }
  
      @Override
      public void onItemSelected(AdapterView&lt;?&gt; item, View arg1, int sort,
              long arg3) {
          // TODO Auto-generated method stub
          int selectedItem = itemValues.getInt(sort, 1);
          Dialog d = new Dialog(this);
          TextView t = new TextView(this);
          t.setText(selectedItem);
          d.setContentView(t);
          d.setTitle("Sonuc!");
          d.show();
  
      }
  
      @Override
      public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
          // TODO Auto-generated method stub
  
      }
  
  
  
  }
  </code></pre>
  
  <p>Problem appear when I use <code>Resources</code>. Also logcat is <a href="http://pastebin.com/W2z1LV5a" rel="nofollow">here</a>. What's the problem and solution of this problem?</p>
  
  <p>EDIT:
  Also here is the array.xml</p>
  
  
  
  <pre><code>&lt;resources&gt;
  
      &lt;string-array name="select"&gt;
          &lt;item&gt;Strength&lt;/item&gt;
          &lt;item&gt;Size&lt;/item&gt;
          &lt;item&gt;Fat loss&lt;/item&gt;
      &lt;/string-array&gt;
  
      &lt;integer-array name="selectValues"&gt;
          &lt;item&gt;1&lt;/item&gt;
          &lt;item&gt;2&lt;/item&gt;
          &lt;item&gt;3&lt;/item&gt;
      &lt;/integer-array&gt;
  
  &lt;/resources&gt;
  </code></pre>