Add new row in Parse class using Android

Unable to create a new line when using Parse in android. I can get, but when I try to add a new line like this, I keep getting false, and a new line is not created.

What am I doing wrong here? I exactly follow what is given in the Parse-Android documentation.

ParseObject storyActivity = new ParseObject("StoryActivity"); storyActivity.put("createdByUser", user); storyActivity.put("story", story); storyActivity.put("type", likeUnlike); return storyActivity.saveInBackground().isCompleted(); 
+1
android
Jan 29 '16 at 13:54 on
source share
3 answers

Check permission at class level. Write to the StoryActivity Security class on the console.

+1
Jan 29 '16 at
source share

Call it like this -

 ParseObject storyActivity = new ParseObject("StoryActivity"); storyActivity.put("createdByUser", user); storyActivity.put("story", story); storyActivity.put("type", likeUnlike); storyActivity.saveInBackground(new SaveCallback() { public void done(ParseException e) { if (e == null) { // your object is successfully created. } else { //error occurred Toast.makeText( context,e.getMessage().toString(),Toast.LENGTH_LONG ); } } }); 

So, in this toast post, you can find out what is causing the problem you are getting.

0
Jan 29 '16 at 15:08
source share

Try this method to set read permissions for a record when a user inserts / updates a record in a parsing database, for example ...

 ParseObject storyActivity = new ParseObject("StoryActivity"); storyActivity.put("createdByUser", user); storyActivity.put("story", story); storyActivity.put("type", likeUnlike); // here first set read write permission like .. // when user update value ya insert new value in database ParseACL postACL = new ParseACL(ParseUser.getCurrentUser()); postACL.setPublicReadAccess(true); postACL.setPublicWriteAccess(true); storyActivity.setACL(postACL); storyActivity.saveInBackground(new SaveCallback() { @Override public void done(ParseException e) { // TODO Auto-generated method stub if (e == null) { // success } else { // fail Log.e("Tag", "getting to fail " + e.getMessage()); } } }); 
0
Feb 04 '16 at 7:00
source share



All Articles