带位置的OpenGraphObject

时间:2013-08-24 14:29:08

标签: android facebook-android-sdk

我想为我的OpenGraphObject添加一个位置(它从地方继承)。 目前我有这个:

OpenGraphObject store = OpenGraphObject.Factory.createForPost("testshoppingguide:store");
store.setTitle(this.store.getName());
store.setDescription(this.store.getName());
store.setProperty("location", )

但是我应该在位置后添加什么?我只找到GraphLocation,但我不确定如何使用它。

1 个答案:

答案 0 :(得分:1)

您希望传入一个GraphObject,其中“id”属性是该位置的ID。

尝试这样的事情:

GraphLocation location = GraphObject.Factory.create(GraphLocation.class);
location.setLatitude(...);
location.setLongitude(...);
store.setProperty("location", location);