请参阅我的应用程序中的此代码段。外部查询返回文件关联的对象,内部查询从该对象返回文件。希望能帮助到你。
ParseQuery<ParseObject> query = ParseQuery.getQuery("ClassName");
query.whereEqualTo("Column", "Your_variable");
query.getFirstInBackground(new GetCallback<ParseObject>() {
public void done(ParseObject object, ParseException e) {
if (object != null) {
ParseFile file = (ParseFile)object.get("File_Coulumn");
file.getDataInBackground(new GetDataCallback() {
public void done(byte[] data, ParseException e) {
if (e == null) {
bitmap=BitmapFactory.decodeByteArray(data, 0, data.length);
//use this bitmap as you want
} else {
// something went wrong
}
}
});
} else {
Toast.makeText(getApplicationContext(), "Exception", Toast.LENGTH_SHORT) .show();
}
}
});