0

So I've linked my android app to back4app parse server. According to their documentation when I run the following code a class is supposed to be created in the database. However Android studio shows the following errors:

  1. cannot resolve symbol SaveCallback
  2. Method does not override method from its superclass
package com.example.android.beastt;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import com.parse.ParseObject;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Toast;

import com.parse.Parse;
import com.parse.ParseException;
import com.parse.ParseUser;

import java.util.Arrays;


public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ParseObject soccerPlayers = new ParseObject("SoccerPlayers");
// Store an object
        soccerPlayers.put("playerName", "A. Wed");
        soccerPlayers.put("yearOfBirth", 1997);
        soccerPlayers.put("emailContact", "a.wed@email.io");
        soccerPlayers.addAllUnique("attributes", Arrays.asList("fast", "good conditioning"));
// Saving object
        soccerPlayers.saveInBackground(new SaveCallback() {
            @Override
            public void done(ParseException e) {
                if (e == null) {
                    // Success
                } else {
                    // Error
                }
            }
        });
    }
}
Tom Fox
  • 897
  • 3
  • 14
  • 34
  • Did you add Android SDK to your project? If not, Take a look at this document https://www.back4app.com/docs/pages/android/how-to-build-an-android-app-on-back4app – uzaysan Apr 24 '20 at 08:10
  • I just found their CRUD (Create, Read, Update and Delete) example for Android, maybe it might help you, here it is: https://www.back4app.com/docs/android/parse-objects/crud – Charles Apr 24 '20 at 21:49
  • Thanks, I'll try installing it again as per the guide – Akul Shivakumar Apr 25 '20 at 07:20
  • Did you initialize the app and connect to the server? https://www.back4app.com/docs/android/parse-android-sdk – MRazian Nov 28 '22 at 12:06

0 Answers0