Is there any way to retrieved selected data in Firebase to a fragment in Kotlin? Not all data only selected row.
I'm new to Kotlin. Please help me.
firstly user login to the system. for this I checked the user name from Firebase. it works properly. But after that, I want to retrieve data of that username into a fragment. In one activity I add five fragments. I need to load all data of that user into one Fragment.
for example in this abi is a username and I need to load all data of only that username into one fragment.
Firebase data

Inside of abi

here's what I added.
val rootRef = FirebaseDatabase.getInstance().reference
val userRef = rootRef.child("User").child(sessionId)
val valueEventListener = object : ValueEventListener {
override fun onDataChange(dataSnapshot: DataSnapshot) {
val name = dataSnapshot.child("fullName").getValue(String::class.java)
val age = dataSnapshot.child("age").getValue(String::class.java)
val phone = dataSnapshot.child("phoneNo").getValue(String::class.java)
val bank = dataSnapshot.child("bankAccNo").getValue(String::class.java)
val password = dataSnapshot.child("passwordRegister").getValue(String::class.java)
nameText.setText(name)
ageText.setText(age)
phoneText.setText(phone)
bankText.setText(bank)
passwordText.setText(password)
}
override fun onCancelled(error: DatabaseError) {
Log.d("TAG", error.getMessage())
}
}
userRef.addListenerForSingleValueEvent(valueEventListener)