如果你想獲得遊戲與有關地方的數據對象,則應在查詢中使用「包括」。
ParseQuery<Offers> query = ParseQuery.getQuery(Offers.class);
//query.equalTo("objectId", "gameId");
query.include("Places");
query.getFirstInBackground(new GetCallback<Offers>() {
@Override
public void done(Offers obj, ParseException e) {
if(e!=null) {
Log.e("err", e.getMessage());
}
else {
Log.d("PlaceName", obj.getParseObject("Places").getString("PlaceName"));
}
}
});
如果你想通過指針來獲取相關的數據(的parseObject只包含ID)
ParseObject place = ParseObject.createWithoutData("Places","id");
place.fetchInBackground(new GetCallback<ParseObject>() {
@Override
public void done(ParseObject object, ParseException e) {
//do what you want
}
});
其粘性第一次嘗試它的parseObject和存儲它直接指向 –
@HardikParmar如何去掉它可以寫下代碼? –
我有帖子ans –