0

Here's my code.

        // The dummy object
        ParseObject dummy = new ParseObject("Dummy");

        //A profile object
        profile = new ParseObject("StudentProfile");
        profile.put("name", "sam");
        //Putting in pointer
        profile.put("dummy",dummy);
        //Saving
        profile.saveEventually(new SaveCallback() {
            @Override
            public void done(ParseException e) {
                if (e==null){
                Toast.makeText(MainActivity.this, "Done", Toast.LENGTH_SHORT).show();
            }else{
                Log.d("error",""+e.getMessage());
                Toast.makeText(MainActivity.this, ""+e.getMessage(), Toast.LENGTH_SHORT).show();
            }
        }});

A new profile object with a pointer to another object(dummy). While trying to call saveEventually I get this error.

java.lang.IllegalStateException: unable to encode an association with an unsaved ParseObject

Fun thing is , when I try saveInBackground(), it works perfectly.

Help would be highly appreciated.

Tanzim Chowdhury
  • 3,020
  • 2
  • 9
  • 21
  • 1
    I think that happens by design. When you call `saveInBackground()` both objects are sent to the server and saved. But when you call `saveEventually()`, it is not handled by the SDK. – Davi Macêdo Feb 25 '20 at 00:35
  • Dont you think the sdk developers should look into it ? Its a very serious issue. And when trying this with current user object the app completely freezes. Hope the parse andoird sdk community will look into this. – Tanzim Chowdhury Feb 25 '20 at 11:43
  • https://github.com/parse-community/Parse-SDK-Android/issues/1006 Just found this github issue, I think you need to have a look at this. – Tanzim Chowdhury Feb 25 '20 at 11:53

0 Answers0