A
A
airows2017-07-01 09:16:14
Java
airows, 2017-07-01 09:16:14

Firebase Database + network requests. How to solve such a problem?

Good day to all.
The question, perhaps, is easy, but I don’t understand something ...
There is an application: the user logs in through Facebook, after authorization, a list of settlements of a specific user is loaded from the Firebase Database. After loading, you need to make a request to receive a weather forecast from any weather service and display the received data in RecyclerView.
The problem is that by calling AsyncTask on the UI thread, it turns out that the data has not yet been retrieved from Firebase, and the requests have already gone, and a NullPointerException is thrown.
Tell me how this problem is solved, or at least in which direction to google?
Thanks in advance to everyone.
UPD: work with the network is implemented without the use of third-party libraries (it should be so according to the assignment)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question