java - How to get data on a reference first before executing other code? -
i need data specific location on firebase , put data inside arraylist before processing it. have this:
final arraylist<string> data = new arraylist<string>(); firebase ref = rootref.child("data"); ref.addlistenerforsinglevalueevent(new valueeventlistener() {} @override public void ondatachange(datasnapshot snap) { (object obj : snap.getchildren) { data.add(obj.getvalue().tostring()); } } ); processdata(data); i'm newbie kind of stuff, think not if there's tons of data read , if user's connectivity slow.
any idea on how solve problem?
i not familiar firebase shocked if did not have sort of equivalent android loader callback "onloadfinished(){...}". should find similar in firebase, , call "processdata(data)" within it.
Comments
Post a Comment