Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to read specifc value under 1 node Android Firebase

I have a data structure that looks like this

TABLENAME {
USERID { 
USERID: ...
DATE: ....
}
}

I want to only read / retrive the DATE value, how can I do that?

I tried:

Log.d("Print Date", snapshotValue.get("DATE")); 

but it doesn't work it says required string found object.

Basically I want to do something like this, if it can be done without using MAP;

String date = snapshot.getValue("DATE");
like image 825
Ben Avatar asked Jan 21 '26 05:01

Ben


1 Answers

Try

snapshot.child("DATE").getValue().toString();
like image 124
Adam Avatar answered Jan 23 '26 21:01

Adam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!