Created
March 28, 2015 03:02
-
-
Save edwardinubuntu/959056f324168598a85e to your computer and use it in GitHub Desktop.
Create ParseFile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create ParseFile | |
final ParseFile file = new ParseFile(ParseUser.getCurrentUser().getUsername() + "_"+ Calendar.getInstance().getTimeInMillis() + ".jpg", image); | |
if (progressDialog!=null && !progressDialog.isShowing()) { | |
progressDialog.show(); | |
} | |
file.saveInBackground(new SaveCallback() { | |
@Override | |
public void done(ParseException e) { | |
final ParseObject imageObject = new ParseObject("GraphicImage"); | |
imageObject.put("imageType", "file"); | |
imageObject.put("imageFile", file); | |
imageObject.saveInBackground(new SaveCallback() { | |
@Override | |
public void done(ParseException e) { | |
if (progressDialog!=null && progressDialog.isShowing()) { | |
progressDialog.dismiss(); | |
} | |
// Clear graphic pick | |
graphicPick = null; | |
// Setup ImageObject | |
imageToUploadObject = imageObject; | |
contentImageView.setImageBitmap(imageBitmapForImageView); | |
} | |
}); | |
} | |
}, new ProgressCallback() { | |
@Override | |
public void done(Integer integer) { | |
Log.d(DailyKind.TAG, "Upload progress: " + integer); | |
progressDialog.setProgress(integer); | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment