9
votes

I am trying to retrieve objects from Parse cloud storage in a button click event in my Main Activity, this is the simple code I copied from the parse.com site examples:

    ParseQuery<ParseObject> query = ParseQuery.getQuery("WtestObj2");
    query.countInBackground(new CountCallback() {

        public void done(int count, ParseException e) {
            if (e == null) {
                //
            } else {
                //
            }
        }
    });

when I build I get the following error, it seems like my "new CountCallback" is creating an anonymous calss which does not implement an abstract method, but I copied the code 100% from parse.com online docs here, what else could be wrong in my Android Studio project?

'anonymous com.mobilevision.wtrend.MainActivity$4' is not abstract and does not override abstract method done(int,ParseException) in CountCallback

1
Do you have the correct ParseException imported? That is, com.parse.ParseException, not java.text.ParseException. - Mike M.
@MikeM. that was it thanks! if you make it as an answer will vote it and make it a solution. Thanks!! - Davide Piras

1 Answers

13
votes

It would seem that you have (or possibly your IDE has) imported the wrong ParseException class. It should be com.parse.ParseException.