Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Add element to Array in parse.com Android

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 603
    Comment on it

    Here I am writing code to add an element to Parse Array.

    It is very simple to add values to parse array. We need to insert using add() or addUnique() instead of put() method.

    So for normal column, we use put() method of ParseObject and for array, we use add() method of ParseObject. Below is the code.

         
    ParseObject parseObject = new ParseObject("Challenge");
                                parseObject.put("name", nameString);
    
                       parseObject.add("array", ParseUser.getCurrentUser());
    
                            parseObject.saveInBackground(new SaveCallback() {
                                @Override
                                public void done(ParseException e) {
    
    
                                    if (e == null) {
                                      System.out.println("Success");
                                    } else {
                                        System.out.println("Error : " + e.getMessage());
                                    }
                                }
                            });
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: