I am new to parse SDK services using Android Studio and I have to ask that how to store more than one row in parse database . I am using back4app parse server whenever I want to put data on data base I.e more than one row then it does not store the first row but the second one as from the code below
ParseObject obj = new ParseObject("Table");
obj.put("Name","John");
obj.put("Score","40");
obj.put("Name","Jack");
obj.put("Score","50");
obj.saveInBackground();
So when I run app then only name and score for Jack stored in database creating one row and I want rows for both John and Jack, Kindly help me resolving this issue
You override your object fields ("name" and "score"), i.e. you delete John
before save. Make a method that save your person:
private void savePerson(String name, String score){
ParseObject obj = new ParseObject("Table");
obj.put("Name",name);
obj.put("Score",score);
obj.saveInBackground();
}
and in code where you want to save person, call created method to do that:
savePerson("John", "40");
savePerson("Jack", "50);