Saturday, 31 August 2013

retrieve Image from parse android

retrieve Image from parse android

The ParseFile file has url image and info, but when it goes to
getDatainBackground it failed, it never go into it. can anyone help me or
any other way to retrieve the image from parse.
ParseFile parseFile = new ParseFile("profileImage.png",
MainActivity.convertBitmapToByteArray(profilePicture));
parseFile.saveInBackground(); _parseUser.put("ProfilePicture", parseFile);
ParseUser user = ParseUser.getCurrentUser();
ParseFile file = (ParseFile)user.get("ProfilePicture");
file.getDataInBackground(new GetDataCallback() {
@Override
public void done(byte[] data, ParseException e) {
if (e == null)
profilePicture = BitmapFactory.decodeByteArray(data,
0, data.length);
else
Log.d("failed", "msg");
}
});

No comments:

Post a Comment