0
ParseRelation<ParseObject> p = country.getRelation("view");
ParseQuery P2 = p.getQuery();

那么是否可以在下一个活动中意图 P2 查询,以便我们可以在下一个活动中使用此查询从解析数据库中获取数据。

4

1 回答 1

0

可悲ParseObject的是不可打包,这将解决我在使用他们的 Android SDK 时遇到的数百个问题。

但是你肯定可以country通过它的对象 id。

// Launching...
Intent i = new Intent(context, Destination.class);
i.putExtra(“relationObjectId”, country.getObjectId());
i.putExtra(“relationFieldName”, “view”);
startActivity(i);

// Then in Destination activity..
Intent i = getIntent();
String relationObjectId = i.getStringExtra(“relationObjectId”);
String relationFieldName = i.getStringExtra(“relationFieldName”);
Country country = ParseObject.createWithoutData(Country.class, relationObjectId);
ParseQuery query = country.getRelation(relationFieldName);

请注意,在再次调用 getRelation() 之前,您可能必须使用fetchIfNeededInBackground().

于 2016-11-03T11:40:04.537 回答