Why isn't my DolphinProfile object being added to my global array list

Below is my class for my main activity. I am attempting to populate my List View table but in order to do that I need to create a list retrievedDolphinProfiles and dynamically add objects to it using the Geo query method.

My problem is that when i receive the data (I have verified this by checks) and attempt to add the object to my list (within the onDataChange method) it does not add for some reason. I suspect this is a Scope problem but I just wanted some help on this

Thanks!

package com.example.dipo.projectdolphinuser;

import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.ArrayAdapter;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.RelativeLayout;

import com.firebase.geofire.GeoFire;
import com.firebase.geofire.GeoLocation;
import com.firebase.geofire.GeoQuery;
import com.firebase.geofire.GeoQueryEventListener;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.Query;
import com.google.firebase.database.ValueEventListener;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;

public class MainActivity extends AppCompatActivity {

private RelativeLayout main, nav;
private ListView listView;


private double userLat, userLong;
private ArrayList<String> retrievedDolphinKeys;
private List<DolphinProfile> retrievedDolphinProfiles;
private int index;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);


    init();



}

private void init() {

    listView = (ListView) findViewById(R.id.dolphinListViewXML_MA);
    main = (RelativeLayout) findViewById(R.id.mainBody);
    nav = (RelativeLayout) findViewById(R.id.navigationLayout);

    retrievedDolphinKeys = new ArrayList<>();
    retrievedDolphinProfiles = new ArrayList<DolphinProfile>();

    index = 0;
    //Sake of demo, location is fixed at PO1 3HT
    userLat = 50.799977;
    userLong = -1.102235;

    getData();

    System.out.println("doedkfoekdeokd   " + retrievedDolphinProfiles.size());


    ListAdapter profilesListAdapter = new SearchDolphinCustomAdapter(this,
            retrievedDolphinProfiles);

    listView.setAdapter(profilesListAdapter);


}



private void getData() {
    DatabaseReference ref = FirebaseDatabase.getInstance().getReference("DolphinLocations/");
    GeoFire geoFire = new GeoFire(ref);

    GeoQuery geoQuery = geoFire.queryAtLocation(new GeoLocation(userLat, userLong), 4.5);

    geoQuery.addGeoQueryEventListener(new GeoQueryEventListener() {

        @Override
        public void onKeyEntered(String key, GeoLocation location) {
            System.out.println(String.format("Key %s entered the search area at [%f,%f]", key,
                    location.latitude, location.longitude));

            FirebaseDatabase databaseRef = FirebaseDatabase.getInstance();

            DatabaseReference myRef = databaseRef.getReference("DolphinProfile");

            Query query = myRef.child(key);

            query.addListenerForSingleValueEvent(new ValueEventListener() {
                @Override
                public void onDataChange(DataSnapshot dataSnapshot) {

                    DolphinProfile dataShot = dataSnapshot.getValue(DolphinProfile.class);
                    retrievedDolphinProfiles.add(dataShot);

                    System.out.println("doedkfoekdeokd   " + retrievedDolphinProfiles.size());
                    System.out.println("doedkfoekdeokd   " + dataShot.getName());


                }

                @Override
                public void onCancelled(DatabaseError databaseError) {

                }
            });


        }

        @Override
        public void onKeyExited(String key) {
            System.out.println(String.format("Key %s is no longer in the search area", key));
        }

        @Override
        public void onKeyMoved(String key, GeoLocation location) {
            System.out.println(String.format("Key %s moved within the search area to [%f,%f]",
                    key, location.latitude, location.longitude));
        }

        @Override
        public void onGeoQueryReady() {

//                getDolphinProfiles();
            System.out.println("All initial data has been loaded and events have been fired!");
        }



        @Override
        public void onGeoQueryError(DatabaseError error) {
            System.err.println("There was an error with this query: " + error);
        }
    });



}

private void getDolphinProfiles() {
    FirebaseDatabase database = FirebaseDatabase.getInstance();

    for (int i=0; i < retrievedDolphinKeys.size(); i++){

        String keyIndex = retrievedDolphinKeys.get(i);

        DatabaseReference myRef = database.getReference("DolphinProfile");

        Query query = myRef.child(keyIndex);

        query.addListenerForSingleValueEvent(new ValueEventListener() {
            @Override
            public void onDataChange(DataSnapshot dataSnapshot) {

                DolphinProfile dataShot = dataSnapshot.getValue(DolphinProfile.class);

            }

            @Override
            public void onCancelled(DatabaseError databaseError) {

            }
        });
    }




}

}