1

Hi I have some issue with calling firebase data from the server.

I can call the single child of data but if I call a nasty child of data(ex: multiple branch of child data), It is not working on kotlin side.

I used ".child()" function on Swift side by just adding ".child()" afterward and it worked on IOS side but I do not understand why the kotlin is not working like that.

Does anyone knows how to solve this problem? I've been searching this problem many days but nobody has a clear solutionenter image description here

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Dowon Lee
  • 21
  • 1

1 Answers1

0

Here the issue is of synchronous values, basically onDataChange is called on a different thread.. long story short try calling sectionRecyclerView.adapter line inside the for loop that or this will do the trick.

Mihir Shah
  • 51
  • 3
  • Hi so you mean that .child() fun is correct but I need to take care onDataChange in a different way right? @Mihir Shah – Dowon Lee Aug 30 '21 at 19:44
  • @DowonLee not exactly child() is correct, the issue is that the fetching is executed in a different thread, so first try logging the values of user inside the for loop and that will help you get the issue. Then try assigning SectionAdapter inside the for loop that will give you a better understanding of the situation. – Mihir Shah Aug 31 '21 at 06:59