0
votes

I'm adopting Parse for push notifications in Android, using the examples straight from Parse.com, and running into a build error. This code:

   ParsePush.subscribeInBackground("", new SaveCallback() {
       @Override
       public void done(ParseException e) {
           if (e == null) {
               Log.d("com.parse.push", "successfully subscribed to the broadcast channel.");
           } else {
               Log.e("com.parse.push", "failed to subscribe for push", e);
           }
       }
   });

Results in the following in Android Studio:

Error:(32, 63) error: is not abstract and does not override abstract method done(ParseException) in SaveCallback Error:(33, 12) error: method does not override or implement a method from a supertype

Any hints?

1
Looks alright. The error indicates that you do not implement the abstract method done properly. Check your imports also. parse.com/docs/android/api/com/parse/SaveCallback.html - Raghunandan

1 Answers

0
votes

You imported the wrong ParseException class.

It should be :

import com.parse.Parse;
import com.parse.ParseException;
import com.parse.ParsePush;
import com.parse.SaveCallback;