Start a new topic

Linking an image does not save with LinkedData

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

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 {

//upload progress changed!

}



@Override

public void onSuccess(Void result) {

//upload complete!

}



@Override

public void onFailure(Throwable error) {

//something went wrong!

}

});

Login or Signup to post a comment