Amir
Amir

Reputation: 1683

Getting numbers from parse.com object in Android

I have an object/list coming from parse.com(using parse sdk) and receive both strings and numbers. While I am able to fetch strings I don't know how to fetch numbers.

This works fine for string as driver:

ParseObject u = (ParseObject)scoreList.get(i);
    String truckName;
 truckName = u.getString("driver").toString();

How do I get the number assuming my "xcor" (assume another property such as "driver") is a number not string.

Upvotes: 0

Views: 86

Answers (1)

Bartek Lipinski
Bartek Lipinski

Reputation: 31448

Maybe I don't understand your question perfectly, but isn't this:

double xcor = u.getDouble("xcor");

just what you need?

(alternatively if you store integer instead of a double you can use int otherVariable = u.getInt("otherVariable");)

Upvotes: 1

Related Questions