Joe
Joe

Reputation: 253

How to get boolean value from the database and add it to a TextView?

I have boolean values stored from a checkbox in my Firebase database and I'm struggling to pull the values from the database. If the user checked the checkbox it will store that value in the database as true or false.

What I'd like to do is to then get that value and put it in a TextView. I've been doing this with strings with a .setText.

Any suggestions for Boolean? I can post any code if needed.

Thanks a lot guys!

Upvotes: 2

Views: 2097

Answers (1)

Kurt Acosta
Kurt Acosta

Reputation: 2557

Use this for booleans:

view.setText(String.valueOf(<boolean value>));

Upvotes: 4

Related Questions