1

I'm trying to use a parse server from back4app as my backend and I'm having troubles with the initial installation part.So I followed the documentation given in back4app to connect my app to the parse server and the installation shows in the dashboard. However when I run the code given below it gives an error saying that cannot resolve symbol Object

    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);
        setContentView(R.layout.activity_main);
        ParseObject myFirstClass = Parse.Object.extend("MyFirstClass");
        myFirstClass.put("name", "I'm able to save objects!");
        myFirstClass.saveInBackground();

    }
}

Any help would be appreciated in solving this error or a tutorial on how to use back4app as a whole

Tom Fox
  • 897
  • 3
  • 14
  • 34

1 Answers1

1

I was having the same issue but was able to resolve by changing code from this:

 ParseObject myFirstClass = Parse.Object.extend("MyFirstClass");

to this:

ParseObject myFirstClass = new ParseObject("MyFirstClass");

For reference:

ParseObject myFirstClass = new ParseObject("MyFirstClass");
        myFirstClass.put("name", "I'm able to save objects!");
        myFirstClass.saveInBackground();

This should allow you to save the object. You can also find more information here: https://dashboard.back4app.com/apidocs?java#objects-api

Mar McRae
  • 26
  • 2
  • 2
    Please don't post only code as answer, but also provide an explanation what your code does and how it solves the problem of the question. Answers with an explanation are usually more helpful and of better quality, and are more likely to attract upvotes. – Mark Rotteveel May 03 '20 at 07:36