title: Setting TextView with string from string array chosen in a ListView in Android
body: <p>Alright, a quick summary. The app opens with a listView (populated by a string array), when you tap one of the items in the list it takes you to another listView (populated by a string array) with items associated with the first item you tapped. In the second listView, i'd like to tap on an item and have it display a textView with associated items from another string array. I have the first two listViews working so far, but can't get the textView to work. I've banged my head over this for two days now and am getting very frustrated. Could you please help?!</p>
  
  <p>Here is my strings xml file:</p>
  
  <pre><code>&lt;string-array name="topics"&gt;
  &lt;item&gt;Idioms&lt;/item&gt;
  &lt;item&gt;Travel&lt;/item&gt;
  &lt;item&gt;Small Talk&lt;/item&gt;
  &lt;item&gt;Tips&lt;/item&gt;
  &lt;item&gt;App Data&lt;/item&gt;
  &lt;/string-array&gt;
  
  &lt;string-array name="idioms"&gt;
      &lt;item&gt;Cash Chow&lt;/item&gt;
      &lt;item&gt;No Spring chicken&lt;/item&gt; 
  &lt;/string-array&gt;
  
  &lt;string-array name="travel"&gt;
      &lt;item&gt;Asking for Change&lt;/item&gt;
      &lt;item&gt;Bus and Train Schedule&lt;/item&gt;
  &lt;/string-array&gt;
  
  &lt;string-array name="idioms_description"&gt;
      &lt;item&gt;A cash cow is a blah blah blah&lt;/item&gt;
      &lt;item&gt;No spring chicken means blah blah blah&lt;/item&gt;
  &lt;/string-array&gt;
  
  &lt;string-array name="travel_description"&gt;
      &lt;item&gt;This is a test for Asking for change&lt;/item&gt;
      &lt;item&gt;This is a test for Bus and train schedules&lt;/item&gt;
  &lt;/string-array&gt;
  </code></pre>
  
  <p>And here is my getIntent and place where I should setText. I left it blank because everything I have tried until now has failed miserably, I just don't know how to get the proper string from the array that was selected.</p>
  
  <pre><code>public class DetailLanguagePoints extends Activity{
  
  private int position;
  private TextView mLanguagePoint;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.detail_view);
          mLanguagePoint = (TextView) findViewById(R.detail.languagepoints);
  
        Bundle extras = getIntent().getExtras();
  
        //int[] arrayIds = new int[]{R.array.idioms, R.array.travel};
        position = extras.getInt("listposition");
  
        int[] stringarrayIds = new int[]{R.array.idioms_description, R.array.travel_description};
  
  
        String[] subTopics = getResources().getStringArray(stringarrayIds[position]);
  
        String description = subTopics[position];
  
        final String TAG = "MyActivity";
        Log.d(TAG,description);
  
        mLanguagePoint.setText(description);      
  
      }
  
  }
  </code></pre>
  
  <p>I found what the problem was with the null exception error, I didn't call <code>findViewById()</code> after <code>setcontentView()</code>.  I did that and it solved the problem, it is now working!! Thank you to all those who provided suggestions!!</p>