How do I make firebase Altime databese understand that this > 29.90 < is a String and not a number?

Asked

Viewed 47 times

-2

Hi everyone I’m developing an app that uses the firebase database.

My problem is that I’m tempting the value of 29.90 in one of my database.

Ex:

Value of product: 29.90

I want to take this value within my internal program.

String value = datasnapshot.Chil("Product value"). getValue(String.class);

However, my program closes.

I tried to pass the value on firebase in the following ways: 29.90 and "29.90" but none worked.

Could the problem be "."?

1 answer

2

So if you’re putting exactly this line of code, the problem could be the "d" missing in "Child," then it should be:

String valor = datasnapshot.child("Valor do produto").getValue();

  • 1

    Thanks friend but I solved the problem...... The error was in another variable in firebase Altime.

  • Ex: I had in Realtime data base a string that stored an address of an image on the internet, but I didn’t realize it was empty. The problem was that I was using the Picasso library.

  • I took the firebase value and stored it in an internal string and passed it to the Picasso library. Picasso.get(). load(" "). Into(imageView); > Gives error if pass empty load

Browser other questions tagged

You are not signed in. Login or sign up in order to post.