0

How to get all data from unique key contained in "lasttime" firebase android and to display in listview android ?

i not understand about that, please help me. Because i make 2 app parent and child. I want to make a history list within one week and then update for the next week, how do I make it?

i use android studio gradle version 4.10.1 and firebase

my format firebase :

 "Sabtu" : {
        "lasttime" : {
          "-LebicAwu9h-zYnhAUD6" : "11 May 2019, 23:29:39",
          "-LebifkPfdnjOwOI-opj" : "11 May 2019, 23:29:54",
          "-LebiiB_NeaNenUNeWMO" : "11 May 2019, 23:30:04",
          "-LebikLsIbAmZjxL1g0p" : "11 May 2019, 23:30:12",
          "-LebimnFXGalhffJpG1s" : "11 May 2019, 23:30:22",
          "-LebipihTqXhKHF0tayj" : "11 May 2019, 23:30:34",
          "-LebiseAuZxDTqofUpFU" : "11 May 2019, 23:30:46",
          "-Lebiv_oLwpYS7IjKi7p" : "11 May 2019, 23:30:58",
          "-LebiyWFMtROe9xW7fVj" : "11 May 2019, 23:31:10",
          "-Lebj0RgHbvBnWT4LQf7" : "11 May 2019, 23:31:22",
          "-Lebj3rOzPhQEKlVdp4H" : "11 May 2019, 23:31:36",
          "-Lebj6n7XxFQuyFZcZZy" : "11 May 2019, 23:31:48",
          "-Lebj9iTGDM4kylT1OPB" : "11 May 2019, 23:32:00",
          "-LebjCdtaVhy3IJyqzmM" : "11 May 2019, 23:32:12",
          "-LebjF_Q3DhnfHiVv5HX" : "11 May 2019, 23:32:24",
          "-LebjIWE_xXBavjbQbFS" : "11 May 2019, 23:32:36",
          "-LebjLvfCUiy4tfz2BFN" : "11 May 2019, 23:32:50",
          "-LebjOr8HH7R1_RvbnlM" : "11 May 2019, 23:33:02",
          "-LebjRmbkJEejEUw_ld_" : "11 May 2019, 23:33:14",
          "-LebjUDr_klTBeaLaXDX" : "11 May 2019, 23:33:24",
          "-LebjX9RUp1QfDwTZJCt" : "11 May 2019, 23:33:36",
          "-Lebj_4qEwEZ9I0n9v05" : "11 May 2019, 23:33:48",
          "-Lebjc0bJU4Q16nvWWZN" : "11 May 2019, 23:34:00",
          "-Lebjex-WJPUXqtYQxGN" : "11 May 2019, 23:34:12",
          "-LeboRI4S9rJnB1T0M4u" : "11 May 2019, 23:55:03",
          "-LeboUGxiKzFCTOJVQ4i" : "11 May 2019, 23:55:15",
          "-LeboWigI-HZk3qM6lMq" : "11 May 2019, 23:55:25",
          "-LeboZ9xcgfHX5DZgV4u" : "11 May 2019, 23:55:35",
          "-LebobJL2NxcTQhPsBG_" : "11 May 2019, 23:55:48",
          "-LebodlQ315gMHFvO5mD" : "11 May 2019, 23:55:58"

not working and not display

Blockquote

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441

1 Answers1

0

try this it can help you to get your data

mReference = FirebaseDatabase.getInstance().getReference("Sabtu")
                .child("lasttime");
        mReference .addValueEventListener(new ValueEventListener() {
            @Override
            public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
                   Log.d("children",dataSnapshot.getKey());
                users_list.add(dataSnapshot.getKey());            
            }

            @Override
            public void onCancelled(@NonNull DatabaseError databaseError) {

            }
        });
Sandeep Malik
  • 1,972
  • 1
  • 8
  • 17