我需要用 ParseFile 保存 ParseObject,但在本地。方法 pinInBackground 给出错误:“无法编码未保存的解析文件”
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
}
});