嗨,我正在尝试从仪表板下载上传到自定义对象中的图像。uid
是我获取自定义对象的id
QBContent.downloadFile(uid, new QBEntityCallbackImpl<InputStream>(){
@Override
public void onSuccess(InputStream inputStream, Bundle params) {
Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
if (bitmap != null) {
bankImage.setImageBitmap(bitmap);
}else {
bankImage.setBackgroundColor(ContextCompat.getColor(getActivity(), R.color.blue));
}
}
@Override
public void onError(List<String> errors) {
for (String error: errors){
Log.d(TAG , "--errors-"+error);
}
}
}, new QBProgressCallback() {
@Override
public void onProgressUpdate(int progress) {
}
});
获取此错误:
找不到您要查找的实体
非常感谢您的帮助。
我试图从Content
获取,而不是从上传图像的Custom
获取。
如果有人在这里着陆,这是代码:
QBCustomObject qbCustomObject = new QBCustomObject("Your_Class_Name", "Custom_Object_Id");
QBCustomObjectsFiles.downloadFile(qbCustomObject, "YOUR_FIELD_TO_FETCH", new QBEntityCallbackImpl<InputStream>() {
@Override
public void onSuccess() {
super.onSuccess();
}
@Override
public void onSuccess(final InputStream result, Bundle params) {
super.onSuccess(result, params);
Log.d(TAG, "successFull--bitmap");
}
@Override
public void onError(List<String> errors) {
super.onError(errors);
}
}, new QBProgressCallback() {
@Override
public void onProgressUpdate(int i) {
}
});
没错:-)