答案 0 :(得分:1)
@kishore jethava is also right but you can also get url from parse then load that url into imageview with the help of any library like Glide or Picassio or even you can download the image manually from the provided url.
ParseQuery<ParseObject> queryPhoto = ParseQuery.getQuery("photo");
queryPhoto.whereEqualTo("trade_id",trade_id);
queryPhoto.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> listPhoto, ParseException e) {
// TODO Auto-generated method stub
if(e == null){
for (ParseObject photo : listPhoto){
ParseFile parseFile = photo.getParseFile("imageFile");
if(parseFile!=null)
{
final String imageULr=parseFile.getUrl();
Glide.with(context).load(imageULr).into(imageView);
}
}
}
}
}
});
答案 1 :(得分:0)
这样做
ParseQuery<ParseObject> queryPhoto = ParseQuery.getQuery("photo");
queryPhoto.whereEqualTo("trade_id",trade_id);
queryPhoto.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> listPhoto, ParseException e) {
// TODO Auto-generated method stub
if(e == null){
for (ParseObject photo : listPhoto){
ParseFile parseFile = (ParseFile)photo.get("imageFile");
final String imageName =photo.getString("imageName");
if (parseFile != null) {
parseFile.getDataInBackground(new GetDataCallback() {
@Override
public void done(byte[] data, ParseException e) {
// TODO Auto-generated method stub
if (data != null && e == null) {
Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0,data.length);
if(imageName.equals("image1"))
imageVIew1.setImageBitmap(bitmap);
else if(imageName.equals("image2"))
imageVIew2.setImageBitmap(bitmap);
else if(imageName.equals("image3"))
imageVIew3.setImageBitmap(bitmap);
else if(imageName.equals("image4"))
imageVIew4.setImageBitmap(bitmap); }
}
});
}
}
}
}
});