0

I am using Android Studio and following cloud code guide of parse.com: https://parse.com/docs/cloud_code_guide

After deploying the first example which defines function "hello" on the cloud, I run below code in my Android project(I call the code in MainActivity:onCreate)

ParseCloud.callFunctionInBackground("hello", new HashMap<String, Object>(), new FunctionCallback<String>() {
    void done(String result, ParseException e) {
        if (e == null) {
            // result is "Hello world!"
        }
    }
});

I get this error:

Error:(29, 116) error: is not abstract and does not override abstract method done(String,ParseException) in FunctionCallback

3 Answers 3

1

You probably forgot to add @override. Mine is working with this code. Good luck!

Map<String, String> params = new HashMap<String, String>();
    ParseCloud.callFunctionInBackground("hello", params, new FunctionCallback<Object>() {
        @Override
        public void done(Object object, ParseException e) {
            Toast.makeText(mContext, object.toString(), Toast.LENGTH_LONG).show();
        }
    });
Sign up to request clarification or add additional context in comments.

Comments

0

Try to call the cloud function via the below code;

    ParseCloud.callFunctionInBackground("hello", new HashMap<String, Object>(), new FunctionCallback<String>() {
        public void done(String result, ParseException e) {
            if (e == null) {
                System.out.println("Result:"+result);
            }
        }

    });

Also ensure that use proper Cloud function name and your Parse application is initialized. Hope this helps.

Regards.

Comments

0

I had the same error!

After a while I've found out that I was importing the wrong ParseException class.

Android Studio auto import the class java.text.ParseException, when the correct one is com.parse.ParseException.

Just change the import and see if it works.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.