I'm having some issues trying to do this because the data is loaded async.
I have an recyclerView and I need to push the data into a list so it can be recycled displaying the infos on the screen, but it turns out to be kinda hard to do this.
That's what I got until now:
refQuestions.addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String s) {
Question question = dataSnapshot.getValue(Question.class);
arrayList.add(question.title);
Log.d("MyApp", question.title);
}
I want the code to kinda "stops" here and only continue to executes after the data has been completely loaded into my array, like some kind of callback.