I need to save ParseObject with ParseFile, but locally. Method pinInBackground gives error: "Unable to encode an unsaved parse file"
I can not call file.saveInBackground. Because I need to use offline mode.
So what should I do?
//get bitmap
ByteArrayOutputStream baos = new ByteArrayOutputStream();
mBitmap.compress(Bitmap.CompressFormat.JPEG, 50, baos);
byte[] data = baos.toByteArray();
Random random = new Random();
//create parse File
final ParseFile file = new ParseFile(random.nextInt(10000) + ".jpeg", data);
parseObject.put(KEY_IMAGE, file);
parseObject.pinInBackground(new SaveCallback() {
@Override
public void done(ParseException e) {
//do some action
}
});