title: Populating a ListView with firebase data
body: <p>I'm trying to populate my ListView but I can't seem to figure it out. I'm able to print the values and also toast then they just wont populate my ListView. Is there anyone that can help me populate it?</p>
  
  <p>MainActivity</p>
  
  <pre><code>package uk.co.jaunt_app.jaunt;
  
  import android.content.Intent;
  import android.os.Bundle;
  import android.support.design.widget.FloatingActionButton;
  import android.support.v7.app.AppCompatActivity;
  import android.view.View;
  import android.widget.ArrayAdapter;
  import android.widget.Button;
  import android.widget.ListView;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import com.crashlytics.android.answers.Answers;
  import com.crashlytics.android.answers.CustomEvent;
  import com.firebase.client.DataSnapshot;
  import com.firebase.client.Firebase;
  import com.firebase.client.FirebaseError;
  import com.firebase.client.ValueEventListener;
  import com.google.firebase.auth.FirebaseAuth;
  import com.google.firebase.auth.FirebaseUser;
  
  import static uk.co.jaunt_app.jaunt.R.id.Posts;
  
  public class MainActivity extends AppCompatActivity{
  
      private FloatingActionButton addmap;
      private Button settingbtn;
      private TextView mNameTextView;
      private TextView mEmailTextView;
      ListView mPosts;
      ArrayAdapter&lt;String&gt; adapter;
      private FirebaseAuth auth;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          getSupportActionBar().setDisplayShowHomeEnabled(true);
          getSupportActionBar().setLogo(R.drawable.jauntlogodark);
          getSupportActionBar().setDisplayUseLogoEnabled(true);
          setContentView(R.layout.activity_main);
          adapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_dropdown_item_1line, Posts);
  
          Firebase.setAndroidContext(this);
  
          Firebase ref = new Firebase(Config.FIREBASE_URL);
          FirebaseUser currentFirebaseUser = FirebaseAuth.getInstance().getCurrentUser();
  
          String uid = currentFirebaseUser.getUid();
          Firebase usersRef = ref.child("Users").child(uid).child("name");
          Firebase emailRef = ref.child("Users").child(uid).child("email");
          Firebase postRef = ref.child("Users").child(uid).child("Maps");
  
          mNameTextView = (TextView) findViewById(R.id.NameTextView);
          mPosts = (ListView) findViewById(Posts);
  
  
          postRef.addValueEventListener(new ValueEventListener() {
              @Override
              public void onDataChange(DataSnapshot snapshot) {
                  for (final DataSnapshot postSnapshot : snapshot.getChildren()) {
                      //Getting the data from snapshot
  
                      Person person = postSnapshot.getValue(Person.class);
                      String posts = "Name: " + person.getMapName() + "\n\n";
  
  
                      Toast.makeText(getApplicationContext(),
                              "Name: " + person.getMapName(), Toast.LENGTH_LONG)
                              .show();
  
                      mPosts.setAdapter(adapter);
                  }
              }
  
              @Override
              public void onCancelled(FirebaseError firebaseError) {
  
              }
          });
  
  
          mEmailTextView = (TextView) findViewById(R.id.EmailTextView);
  
          emailRef.addValueEventListener(new ValueEventListener() {
              @Override
              public void onDataChange(DataSnapshot dataSnapshot) {
  
                  String email = dataSnapshot.getValue(String.class);
                  mEmailTextView.setText(email);
  
              }
  
              @Override
              public void onCancelled(FirebaseError firebaseError) {
  
              }
          });
  
  
  
          addmap = (FloatingActionButton) findViewById(R.id.add_map);
          addmap.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
  
  
                  Answers.getInstance().logCustom(new CustomEvent("Added Map"));
                  Intent intent = new Intent(MainActivity.this, MapStartActivity.class);
                  startActivity(intent);
              }
          });
  
          settingbtn = (Button) findViewById(R.id.settingbtn);
          settingbtn.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Intent intent = new Intent(MainActivity.this, SettingsActivity.class);
                  startActivity(intent);
              }
          });
  
      }
  
  }
  </code></pre>