我剛剛解決了我的問題。它通過使用CallBackMethod工作。代碼如下:
public static ParseObject user= new ParseObject("UserInfo");
user.getParseObject("info").fetchIfNeededInBackground(new GetCallback<ParseObject>() {
@Override
public void done(ParseObject object, ParseException e) {
// TODO Auto-generated method stub
ParseObject userinfo = object;
String doctor = userinfo.getString("door");
String allergies = userinfo.getString("algies");
String medicalNote = userinfo.getString("mediote");
String medications = userinfo.getString("medic");
String medicalCondition = userinfo.getString("medicalCondition");
docInfo.setText(doctor);
medication.setText(medications);
medNotes.setText(medicalNote);
medCond.setText(medicalCondition);
alergiesReact.setText(allergies);
Log.i("userinfo", "" + userinfo);
}
});
嗨,你是試圖檢索您的Parse數據庫中的現有對象,或者你是否正在創建一個新的對象? – 2014-11-21 06:57:58
感謝@ mussharapp的回覆。它通過使用GetCallback工作。我正在檢索Parse數據庫中的現有對象。 – 2014-11-21 18:02:10