wait until firebase retrieves data

后端 未结 9 1125
不思量自难忘°
不思量自难忘° 2020-11-29 08:33

I want to build a method that returns a child value in FireBase. I tried to do something like this:

public String getMessage(){

           


        
9条回答
  •  借酒劲吻你
    2020-11-29 09:01

    Sorry to be a little late to this party but rather than have firebase return a value you could set up an observer / view model, then when you run your async firebase function the onData method is called from this you would update your view models data which then triggers its onDataChanged method which you can then update your layout from

提交回复
热议问题