Home:ALL Converter>How to get specific data uid/uuid from Firebase

How to get specific data uid/uuid from Firebase

Ask Time:2019-10-10T15:00:37         Author:Pify

Json Formatter

I am new to android. i need help to get uid from firebase. Let's say I have 2 data in my database, and I want to find the 2nd data uid.

enter image description here

i want to get the data in specific uid FROM Firebase

Author:Pify,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/58317181/how-to-get-specific-data-uid-uuid-from-firebase
Android Geek :

Try this\n\nDatabaseReference mUsersDatabase;\n//for getting groups data\nmGroupsDatabase=FirebaseDatabase.getInstance().getReference().child(\"groups\");\n\n//add listener for getting uid or key\nmUserDatabase.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n if (dataSnapshot.exists()) \n {\n dataSnapshot.getKey();\n }\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n\n\nFor getting current user uid\n\nprivate FirebaseAuth mAuth;\nString mCurrentUserId;\n\nmAuth = FirebaseAuth.getInstance();\nmCurrentUserId = mAuth.getCurrentUser().getUid();\n\n\nHope it works for you!!",
2019-10-10T07:32:04
yy