Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

what is datasnapshot.getkey() in android studio

Query reference=FirebaseDatabase.getInstance().getReference().child("products").orderByChild("name").equalTo("iphon");
reference.addListenerForSingleValueEvent(new ValueEventListener() {
    @Override
    public void onDataChange(DataSnapshot dataSnapshot) {
        for (DataSnapshot childSnapshot: dataSnapshot.getChildren()) {
            String key=childSnapshot.getKey();
            Log.i(TAG,key);
        }
    }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #android #studio
ADD COMMENT
Topic
Name
9+4 =