[英]cannot resolve symbol Object in Object.,extend
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.我正在尝试使用 back4app 中的解析服务器作为我的后端,但我在初始安装部分遇到了问题。所以我按照 back4app 中给出的文档将我的应用程序连接到解析服务器,安装显示在仪表板中。 However when I run the code given below it gives an error saying that cannot resolve symbol Object
但是,当我运行下面给出的代码时,它会给出一个错误,提示无法解析符号 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在解决此错误或有关如何整体使用 back4app 的教程中,我们将不胜感激
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.这应该允许您保存 object。 You can also find more information here: https://dashboard.back4app.com/apidocs?java#objects-api
您还可以在此处找到更多信息: https://dashboard.back4app.com/apidocs?java#objects-api
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.