I am trying to display the phonebook contacts' numbers in a RecyclerView but only those are registered in the Firebase database where the contacts numbers are the key.
For that, I am trying to compare an ArrayList from the phone book and one from Firebase database and then saving the results in a third ArrayList that I aim to use it in the RecyclerViewAdapter.
The two problems:
- I can only access Firebase database data inside the listeners of the references, so the size of the third ArrayList outside these listeners is always 0.
- I can not use FirebaseRecyclerAdapter to display the custom third ArrayList.
So, how can I compare these values to get a third accessible ArrayList?