title: firebase get data as array
body: <p>I am trying to implement firebase into my Android app and I want to be able to pull all the entries in firebase in the order they display in into one string array to be put into a ListView
  Here is the raw JSON:</p>
  
  <pre><code>[ 5, "quot", "waaaaa", "also a quote", "oh this one is a little longer man", "gosh really long.   wow.  im very inspired.  golly gee wiz" ]
  </code></pre>
  
  <p>and the code I am using to try and get it:</p>
  
  <pre><code>public class MyActivity extends ListActivity {
  ArrayList&lt;String&gt; LIST = new ArrayList&lt;String&gt;();
  Boolean wow = true;
  Context context = this;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      Firebase.setAndroidContext(context);
      updateList();
  
  
  }
  public void makeList(ArrayList&lt;String&gt; input){
      setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.mylist,input));
      ListView listView = getListView();
      listView.setTextFilterEnabled(true);
      listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
          public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                                  int position, long id) {
              // When clicked, show a toast with the TextView text
              Toast.makeText(getApplicationContext(),
                      ((TextView) view).getText(), Toast.LENGTH_SHORT).show();
          }
      });
  }
  public void updateList() {
  
      Firebase myFirebaseRef = new Firebase("https://admin1.firebaseio.com/");
      myFirebaseRef.child("0").addValueEventListener(new ValueEventListener() {
          @Override
          public void onDataChange(DataSnapshot snapshot) {
              System.out.println(snapshot.getValue());
              int length = Integer.parseInt(snapshot.getValue().toString());
              Firebase myFirebaseRef = new Firebase("https://admin1.firebaseio.com/");
              for(int i=1; i&lt;length; i++) {
                  String doIt = Integer.toString(i);
                  myFirebaseRef.child(doIt).addValueEventListener(new ValueEventListener() {
                      @Override
                      public void onDataChange(DataSnapshot snapshot) {
                          System.out.println(snapshot.getValue());
                          LIST.add(snapshot.getValue().toString());
                      }
  
                      @Override
                      public void onCancelled(FirebaseError error) {
                      }
                  });
              }makeList(LIST); 
          }
  
          @Override
          public void onCancelled(FirebaseError error) {
          }
      });
  
      }
  </code></pre>
  
  <p>}</p>
  
  <p>I was thinking that I could set the first (0th) object to be the number of entries and then cycle through the entire file using .getValue but when this is run I get out of memory exceptions and the app force closes.  All I am sure of is that the relevant firebase stuff is the issue and not the ListView.  Thanks for any tips. </p>