简体   繁体   中英

Data is not saving on Parse.com in android

I am working with online server Parse.com I initialize it at application level using this piece of code

    @Override
    public void onCreate() {
        super.onCreate();
        ParseACL defaultACL = new ParseACL();
        defaultACL.setPublicReadAccess(true);
        defaultACL.setPublicWriteAccess(true);
        ParseACL.setDefaultACL(defaultACL, true);
        Parse.enableLocalDatastore(this);
        Parse.initialize(this, "7m7gwopMVGDb6ERXufUim9Kk7ITlJ2umzUZUQNTV", "xl31lTPF1Qefv8nwRl4qlGLC6UQOiFfhDKQnJNnN");
    }

and then saving test object value using this code but data do not save on the parse object

ParseObject testObject = new ParseObject("TestObject");
testObject.put("foo", "bar");
testObject.saveInBackground();

Can anybody tell the reason it's happening. I am trying from two days but didn't found any solution. please help meto do this

try and check what you get error ..

ParseObject testObject = new ParseObject("TestObject");
    testObject.put("foo", "bar");
    testObject.saveInBackground(new SaveCallback() {

        @Override
        public void done(ParseException e) {
            // TODO Auto-generated method stub
            if (e == null) {
                Log.e("Check ... ", " Success ....");
            } else {
                Log.e("Check ... ", " Ohhh Error  ...." + e.getMessage());
            }
        }
    });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM