Marcin
Marcin

Reputation: 151

How to get Google plus Person's object type

The documentation at Android Developers page states that Person.getObjectType() returns an int value as object type, but possible values are "person" and "page". How can I check if object is type of "person" or type of "page"? equals() doesn't allow to compare int with String and I have no idea how can I make that comparison.

Upvotes: 2

Views: 278

Answers (2)

Alexis C.
Alexis C.

Reputation: 93842

May you can check with this :

int type = getObjectType();

if(type == Person.ObjectType.PAGE)
 //this is a page
else if(type == Person.ObjectType.PERSON)
 //this is a person

Upvotes: 1

SJuan76
SJuan76

Reputation: 24875

I agree that the documentation does not express it well, but if you look for a little more you find that it is refering to constants, defined here (in fact there is a link from the page you posted)

http://developer.android.com/reference/com/google/android/gms/plus/model/people/Person.ObjectType.html

Upvotes: 2

Related Questions