Firebase Realtime database getvalue() not mapping the object

后端 未结 4 801
长发绾君心
长发绾君心 2021-01-25 00:41

This is my firebase chat structure(see image below). I want to get only amitpal_name value not the others but this method fetching me all the values
I had also use this

4条回答
  •  无人及你
    2021-01-25 01:32

    DatabaseReference ref = FirebaseDatabase.getInstance().getReference().child("ChatMessage" ).child( "msg").child("amitpal_name");
        ref.addValueEventListener(new ValueEventListener() {
        @SuppressLint("SetTextI18n")
        @Override
        public void onDataChange ( @NonNull final DataSnapshot dataSnapshot2){
        }
    }
    

提交回复
热议问题