title: Split out array list into separate strings
body: <p>I have created an array of values from my SQLite database - this comprises of just two values from two different columns from an inner joined table.</p>
  
  <p>in my SQLDatabaseHelper.java:</p>
  
  <pre><code>public List&lt;List&lt;String&gt;&gt; getAllAnswersByQuestion1() {
      List&lt;String&gt; array1 = new ArrayList&lt;String&gt;();  
      List&lt;String&gt; array2 = new ArrayList&lt;String&gt;();  
  
      SQLiteDatabase db = this.getReadableDatabase();
  
      String selectQuery = "SELECT  * FROM " + TABLE_ANSWERS + " ta, "
              + TABLE_QUESTION + " tq, " + TABLE_QUESTANS + " tqa WHERE  ta." + ASID
              + " = " + "tqa." + ASID + " AND tq." + QID + " = "
              + "tqa." + QID;
  
     Cursor c = db.rawQuery(selectQuery, null);
     if (c.moveToFirst()) {
      do {
  
       String questdescr = c.getString(c.getColumnIndex(QDESCR));
       String questid = c.getString(c.getColumnIndex(QID));
       array1.add(questdescr);
       array2.add(questid);
  
      } while (c.moveToNext());
  
   }
     List&lt; List&lt;String&gt; &gt; listArray = new ArrayList&lt; List&lt;String&gt; &gt;();
     listArray.add(array1);
     listArray.add(array2);
  
     return listArray;
  
  }
  </code></pre>
  
  <p>I want to pass these to my main activity. Specifically I would like to split out the array into separate strings so I can assign those values to separate edittext fields.</p>
  
  <p>This is my current attempt in my main activity:</p>
  
  <pre><code>    public void showNextRandomQuestion()
      {
      SQLDatabaseHelper db = new SQLDatabaseHelper(this);
  
      StringTokenizer tokens = new StringTokenizer(db.getAllAnswersByQuestion1(), ",");
      String first = tokens.nextToken();
      String second = tokens.nextToken();
  
      questionView.setText(first);
      answerText1.setText(second);
      }
  </code></pre>
  
  <p>However the code will not compile as it wants to either 'change the return type of 'getAllAnswersByQuestion1() to string' - or 'Remove argument to match StingTokenizer(String)'</p>
  
  <p>Can't seem to get around this. </p>