• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps retrieve values from Json

AlexeyS

Newbie
Mar 16, 2017
20
2
Hello. I retrieve float variable from Json Object and it's works wonderful.

float grade = Float.parseFloat(root.getString("grade_json));

The problem is that sometimes, there are no grade, and the value inside grade_json is "N/A" and i get an error.

How can i solve this problem? I want to put Null into grade and continue the app.

Thank you
 
Last edited:

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones