Home How to array listing index from Firebase on Android
Reply: 0

How to array listing index from Firebase on Android

user1476
1#
user1476 Published in April 26, 2018, 5:26 pm
0 --> David
1 --> Alice
2 --> Jayden
3 --> Nicole
4 --> David

this sequence shows 0 and 4 David's records. I want to find David's records and find index values.

find --> David  
Situated shows list --> data to recyclerview listing

i want to do My Firebase ;

  "Node" : {
    "-L1pFRQg8anT4_-4V60B" : {
    "name" :"David"
     "note" : " firs note"
    },  "-L1pFRQg8anT4_-4V2342" : {
    "name" :"Alice"
     "note" :"note values"

    },  "-L1pFRQg8anT4_-65656" : {
    "name" :"Jayden"
     "note" :"note values"
    },  "-L1pFRQg8anT4_-sajkfhsaj" : {
    "name" :"Nicole"
     "note" :"note values"
    },  "-L1pFRQg8anT4_-jwquh24" : {
    "name" :"David"
     "note" :"second note"
    },

I know how to read and print data with Firebase. I know how to use FirebaseRecyclerview. But I have to find out in what order David is in the order of number. So if I called "David", it would be easy to show Davids in Recyclerview. I can do that. It is difficult to print the rank value of "David" among other data. etc 0-4

Query query = FirebaseDatabase.getInstance ()
             .getreferen by ()
             .child ( "node")
             .orderbychild ( "name");

When I sort by name, I want to get "David" in position number and print it as "note" data and "position number".

I want to do index values

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.326324 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO