Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 688 Vote(s) - 3.51 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get the number of children for a specific value in firebase database android?

#1
I am creating an app for android. I would like to get the number of children for a specific value in the firebase database. Then after the user clicks on a button, it will take that data convert it to a percentage, and display it in a textview. I can get the amount of children for each value and printing it to the monitor but when I use the same code and put it in a textview it prints out the last line, not all of it. So my question is how can I get the number of children for a specific value and have it be "compatible" with a textview.



Reply

#2
Are you referring to [getChildrenCount()][1]? It returns the number of immediate children in your reference. The return type is long so it will be easily manipulate the value, or display it on your textView.


[1]:

[To see links please register here]

Reply

#3
[`datasnapshot.getChildrenCount()`][1] method returns the count which you will get in the observer you added to your database reference.


[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through