title: How to store String output to an array in Java
body: <p>I am getting a string output to this <code>c.getString(0)</code> method. I want to know how do I store this output into an array in Java? This <code>c.getString(0)</code> method is in a while loop. Each time the while loop runs, I want to store whatever the value I get with <code>c.getString(0)</code> method to store in an array. How can I do that? </p>
  
  <pre><code>private void showList() {
  
      DataBaseHelper db = new DataBaseHelper(this);
          db.open();
      c = db.retriveall();
      if (c.moveToFirst()) {
          do {
              Toast.makeText(MainActivity.this,
                      "_id: " + c.getString(0) + "\n",
                      Toast.LENGTH_LONG).show();
          } while (c.moveToNext());
      }
  
  }
  </code></pre>
  
  <p>For now I'm showing it an toast message. Instead of showing I want to store it to an array. please help me</p>