I have a method that reads some data from the firebase database.
Let's call it getMyData()
I am attaching a firebaseQuery.addListenerForSingleValueEvent(new ValueEventListener() {...
.
My code structure is something like this.
SomeDataType myData = getMyData(); if(myData==someCondition){//some logic} else{//some logic}
The problem is that the event listener doesn't get fired until my code has passed.
So something like this happens SomeDataType = null
and it goes to my where clause.
firebase
uses events so it's not linear code execution but I am a little confused... Can you help me?