Note that there are some explanatory texts on larger screens.

plurals
  1. POString array list display problem
    text
    copied!<p>I have create to String array one is "word" another is "sentence".</p> <pre><code> &lt;resources&gt; &lt;string-array name="word"&gt; &lt;item&gt; the&lt;/item&gt; &lt;item&gt; a&lt;/item&gt; &lt;item&gt; is&lt;/item&gt; &lt;item&gt; you&lt;/item&gt; &lt;item&gt; to&lt;/item&gt; &lt;/string-array&gt; &lt;string-array name="sentence"&gt; &lt;item&gt; the little boy&lt;/item&gt; &lt;item&gt; a good boy&lt;/item&gt; &lt;item&gt; is about me&lt;/item&gt; &lt;item&gt; then you give&lt;/item&gt; &lt;item&gt; was to come&lt;/item&gt; &lt;/string-array&gt; &lt;/resources&gt; </code></pre> <p>Now i am trying access these two string array from the java code. which is</p> <pre><code> final String words []=getResources().getStringArray(R.array.word); final TextView tw=(TextView)findViewById(R.id.txtWord); tw.setText(words [item]); final String []sent=getResources().getStringArray(R.array.sentence); TextView ts=(TextView)findViewById(R.id.txtSen); ts.setText(sent[item]); Button btnNext=(Button)findViewById(R.id.btnright); btnNext.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { for(item=0;item&lt;words.length;item++){ tw.setText(words [item]); for(item=0;item&lt;sent.length;item++){ tw.setText(sent[item]);} } } }); } } </code></pre> <p>Iniailly Word is place to display words array and Sentence is place to display sentence array so dont be confuse. Here my intention is to display all above five item one item at a time only change word and sentence simultaneously if i click the next(>>) button above figure. but only word[0] and sent[0] was display. first time but cant not display if click >> button, which it turn to display "a" and "a good boy" respective position. Do you Have any idea behind this problem? Also want to change index from the bottom|left corner index. if i click next word and sentence.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload