title: Random array from resource Android
body: <p>How can I get a random question in java from the resource file using following xml:</p>
  
  <pre><code>&lt;array name="question1"&gt;
      &lt;item name="id"&gt;1&lt;/item&gt;
      &lt;item name="question"&gt;Question 1?&lt;/item&gt;
      &lt;item&gt;@array/possible_answers1&lt;/item&gt;
      &lt;item name="correct_answer"&gt;1&lt;/item&gt;
  &lt;/array&gt;
      &lt;string-array name="possible_answers1"&gt;
          &lt;item&gt;Answer1&lt;/item&gt;
          &lt;item&gt;Answer2&lt;/item&gt;
          &lt;item&gt;Answer3&lt;/item&gt;
          &lt;item&gt;Answer4&lt;/item&gt;
      &lt;/string-array&gt;
  
  &lt;array name="question2"&gt;
      &lt;item name="id"&gt;2&lt;/item&gt;
      &lt;item name="question"&gt;Question 2?&lt;/item&gt;
      &lt;item&gt;@array/possible_answers2&lt;/item&gt;
      &lt;item name="correct_answer"&gt;3&lt;/item&gt;
  &lt;/array&gt;
      &lt;string-array name="possible_answers2"&gt;
          &lt;item&gt;Answer1&lt;/item&gt;
          &lt;item&gt;Answer2&lt;/item&gt;
          &lt;item&gt;Answer3&lt;/item&gt;
          &lt;item&gt;Answer4&lt;/item&gt;
      &lt;/string-array&gt;
  </code></pre>
  
  <p></p>
  
  <p>To get the first question in java I use:</p>
  
  <pre><code>String[] str_quest = res.getStringArray(R.array.question1);
  str_question = str_quest[1];
  </code></pre>
  
  <p>but how can I get random question?
  Thanks for reading!</p>