title: Problem:String array set on TextView
body: <p>I want to change text from the textview when I was click the next button. I have try this code but could not get right direction. would you please fix it.</p>
  
  <pre><code>public class StringTestActivity extends ListActivity {
  TextView t;
  int count=0;
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      t=(TextView)findViewById(R.id.text);
  
      Resources res = this.getResources();
      final String[] capital = res.getStringArray(R.array.Cap);
  
         //ArrayAdapter&lt;String&gt; n=new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1,capital);
         //setListAdapter(n);
      Button next=(Button)findViewById(R.id.btnNext);
      next.setOnClickListener(new OnClickListener() {
  
          @Override
          public void onClick(View v) {
              if(count&lt;capital.length-1)
              t.setText(capital[count]);
              count++;
          }
  
      });
  </code></pre>
  
  <p>}
   }</p>
  
  <p><strong>Edit:</strong> I have faced this error message.
  <img src="https://i.stack.imgur.com/HiylN.png" alt="enter image description here"></p>
  
  <p><strong>again edited:</strong> main.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="vertical" android:layout_width="fill_parent"
     android:layout_height="fill_parent"&gt;
  
     &lt;TextView android:id="@+id/list" android:layout_width="fill_parent"
      android:layout_height="wrap_content" android:hint="text" /&gt;
  
     &lt;Button android:text="Next" android:id="@+id/btnNext"
   android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;   &lt;/Button&gt;        
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>res/string/array.xml</p>
  
  <pre><code>  &lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;resources&gt;
    &lt;string-array name="Cap"&gt;
      &lt;item&gt;A&lt;/item&gt;
      &lt;item&gt;B&lt;/item&gt;
      &lt;item&gt;C&lt;/item&gt;
      &lt;item&gt;D&lt;/item&gt;
    &lt;/string-array&gt;
   &lt;/resources&gt;
  </code></pre>