I am trying to use LinkedData to attach a picture to my entity. When I call save, the data gets uploaded but the file attachment is not saved. What is wrong?
kinveyClient.linkedData("myCollection", Entity.class).save(myFarm, new KinveyClientCallback() {
@Override
public void onSuccess(Entity result) {
Log.i(TAG, result.toString());
}
@Override
public void onFailure(Throwable error) {
Log.i(TAG, error.getMessage());
}
});
1 person has this question
1 Comment
E
Edward
said
over 7 years ago
LinkedData extends AppData, so the standard save/retrieve methods can be accessed through an instance of LinkedData.
Try adding an `UploadProgressListener` as the third parameter to the save method, which will provide progress updates the file is uploaded.
kinveyClient.linkedData("myCollection", Entity.class).save(myFarm, new KinveyClientCallback() {
@Override
public void onSuccess(Entity result) {
Log.i(TAG, result.toString());
}
@Override
public void onFailure(Throwable error) {
Log.i(TAG, error.getMessage());
}
}, new UploaderProgressListener() {
@Override
public void progressChanged(MediaHttpUploader uploader) throws IOException {
Edward
kinveyClient.linkedData("myCollection", Entity.class).save(myFarm, new KinveyClientCallback() {
@Override
public void onSuccess(Entity result) {
Log.i(TAG, result.toString());
}
@Override
public void onFailure(Throwable error) {
Log.i(TAG, error.getMessage());
}
});
1 person has this question