1

I'm new to Parse and am trying to save a new row to my table (on Android). I've made sure that all my columns that I want to add to are of type String, as well as my objects.

Here is the code that I use to save it to the database:

        ParseObject accountObj = new ParseObject("networks");

        accountObj.add("token", token);
        accountObj.add("parse_user", parseUser);
        accountObj.add("type", "facebook");
        accountObj.add("fb_profile_url", profileUrl);

        accountObj.saveInBackground(); // expected type string but got array

Could somebody please explain what is going on? I've tried deleting the class and starting fresh, but it just gives me the same answer.

1 Answer 1

3

I'm not sure what ParseObject.add() does, but the docs say to use ParseObject.put() instead.

From the docs:

ParseObject gameScore = new ParseObject("GameScore");
gameScore.put("score", 1337);
gameScore.put("playerName", "Sean Plott");
gameScore.put("cheatMode", false);
gameScore.saveInBackground();

Source: https://parse.com/docs/android/guide#objects-saving

This could solve your issue, as perhaps the .add() function is used to add objects to an array (hence the array error).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.