Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trouble with the Parse tutorial (Android)

I am trying to use Parse to program an Android app. I am following the tutorial on this link: https://www.parse.com/docs/android_guide

While the tutorial/guide is fairly straight forward, I am having problem with a query to the Parse database. The specific part of the guide is: https://www.parse.com/docs/android_guide#objects-retrieving

Code from relevant section:

ParseQuery<ParseObject> query = ParseQuery.getQuery("GameScore");
query.getInBackground("xWMyZ4YEGZ", new GetCallback<ParseObject>(){ 
    public void done(ParseObject object, ParseException e){ 
        if (e == null){ 
        // object will be your game score 
        } else { 
        // something went wrong 
        } 
    } 
});

I am using Android Studio 1.0.1, and the error I am getting is:

Class 'Anonymous class derived from GetCallback' must be either be declared abstract or implement abstract method 'done(T,ParseException) in GetCallback

Any help or suggestions on how to solve this would be greatly appreciated, thanks.

EDIT:

Turns out it was just my database on Parse.com that was somehow corrupted... Creating a new database fixed it, for whatever reason. I do however have another problem. I can debug inside the done function, and the object contains all the information. However, I cannot extract it outside the done function. How is that done? Thanks.

like image 220
David Avatar asked Nov 01 '22 11:11

David


1 Answers

I got the same error. In my case I auto imported wrong library:

import java.text.ParseException;

instead of

import com.parse.ParseException;

Just check your import.

like image 159
Andrey Dobrikov Avatar answered Nov 15 '22 05:11

Andrey Dobrikov