title: How can I process a SQLite dataset in Android
body: <p>I need to process a SQLite dataset in an Android system.</p>
  
  <p>In my dataBaseHelper file (DataBaseAccessor) I have the following code (which when attached to a listview shows the relevant data).</p>
  
  <pre><code>public static ArrayList&lt;QuestionListQuestion&gt; getQuestionListQuestions(long id){
  String qry = "select QuestionListQuestionID, QuestionListQuestionQuestionListID, QuestionListQuestionQuestionID, QuestionListQuestionSortOrder, QuestionListQuestionSupplementalQuestionIDYes, QuestionListQuestionSupplementalQuestionIDNo, QuestionListQuestionSupplementalQuestionIDText, QuestionListQuestionSurveyGroupID from QuestionListQuestion  where  QuestionListQuestionQuestionListID=" + id;
  ArrayList&lt;QuestionListQuestion&gt; list = new ArrayList&lt;QuestionListQuestion&gt;();
  try{
      Cursor cursor = wdb.rawQuery(qry, null);
  while (cursor.moveToNext()) {
  QuestionListQuestion questionlistquestion = new QuestionListQuestion();
      questionlistquestion.QuestionListQuestionID = cursor.getLong(0);
      questionlistquestion.QuestionListQuestionQuestionListID = cursor.getLong(1);
      questionlistquestion.QuestionListQuestionQuestionID = cursor.getLong(2);
      questionlistquestion.QuestionListQuestionSortOrder = cursor.getLong(3);
  questionlistquestion.QuestionListQuestionSupplementalQuestionIDYes = cursor.getString(4);       questionlistquestion.QuestionListQuestionSupplementalQuestionIDNo = cursor.getString(5);
  questionlistquestion.QuestionListQuestionSupplementalQuestionIDText = cursor.getString(6);
  questionlistquestion.QuestionListQuestionSurveyGroupID = cursor.getLong(7);
  list.add(questionlistquestion);
  }
      cursor.close();
  }
  catch (Exception e) {
      e.printStackTrace();
  }
  return list;
  }
  </code></pre>
  
  <p>I now need to extend the system so that I can process the data and create new records in another table based on the original list returned.</p>
  
  <p>I tried the following attached to a button (selecting the relevant list ID from a spinner):-</p>
  
  <pre><code>QuestionListID = (String) SiteGenerateQuestions.this.spnQuestL.getSelectedItem().toString();
  long SpinnerSelectedBT;
  SpinnerSelectedBT = GenerateQuestions.this.spnQuestL.getSelectedItemId();
  list = DatabaseAccessor.getQuestionListQuestions(SpinnerSelectedBT);
  for (int i=0; i &lt; list.size(); i++){
  Toast.makeText(SiteGenerateQuestions.this," list.get(" + i + ")   = " + list.get(i) + " "  , Toast.LENGTH_SHORT).show();
  }
  </code></pre>
  
  <p>The Toast displays the following:-</p>
  
  <pre><code>list.get(0) =  com.tw.question.entity.QuestionListQuestion@407a6F70
  list.get(1) =  com.tw.question.entity.QuestionListQuestion@407bc170
  etc...
  </code></pre>
  
  <p>How can I get access to the actual data instead of ... .entity.QuestionListQuestion@407bc170 or am I completely off-track?</p>
  
  <p>Many Thanks</p>