Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Farzan Maghami
1,005 PointsParse Local Datastore - pinInBackground()
I am attempting to use the Parse local datastore feature on Android and am having a problem at the very first step, I simply pasted the sample code:
Parse.enableLocalDatastore(this);
Parse.initialize(this, "xxxxxxxxxxxxxxxxxxxxxxxxxxx", "xxxxxxxxxxxxxxxxxxxxxxxxxxx");
ParseObject gameScore = new ParseObject("GameScore");
gameScore.put("score", 1337);
gameScore.put("playerName", "Sean Plott");
gameScore.put("cheatMode", false);
gameScore.pinInBackground();
And Android studio gives the following error: cannot find symbol method pinInBackground()
Ultimately I would like to have an adapter available to use offline, i.e:
ParseQueryAdapter<ParseObject> adapter = new ParseQueryAdapter<ParseObject>(this, "TestObject");
adapter.pinInBackground(); //Is this possible??
1 Answer
Ben Jakuben
Treehouse TeacherI haven't used the local datastore yet, but it looks awesome! It looks like the pinInBackground() method requires a SaveCallback parameter.
The ParseQueryAdapter class does not have any pin methods, and it doesn't extend ParseObject, so it looks like you would need to try something else for your 2nd question.