ParseObject()具有受保护的访问权限

时间:2015-06-22 02:26:48

标签: java android parse-platform

还在试图找出这个Parse的东西。我收到的错误是Parse受到保护。我已经尝试将它放在自己的类扩展Object中,但后来我遇到了更多的错误。任何建议都会有帮助。

        mSignUp.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            String firstName = mFirstName.getText().toString().trim();
            String lastName = mLastName.getText().toString().trim();
            String email = mEmail.getText().toString().trim();
            String phone = mPhone.getText().toString().trim();
            String password = mPassword.getText().toString().trim();
            ParseObject dataObject = new ParseObject();
            dataObject.put("Name", firstName);
            dataObject.put("Last name", lastName);
            dataObject.put("Email", email);
            dataObject.put("Password", password);
            dataObject.put("Phone", phone);
            dataObject.saveInBackground();

1 个答案:

答案 0 :(得分:0)

这是一个解析用户,为什么不使用ParseUser? 您正在使用ParseObject,但未定义类名:

ParseObject dataObject = new ParseObject("ClassName???");

尝试使用以下代码

ParseUser user = new ParseUser();
user.setUsername("my name");
user.setPassword("my pass");
user.setEmail("email@example.com");

// other fields can be set just like with ParseObject
user.put("phone", "650-253-0000");

user.signUpInBackground(new SignUpCallback() {
  public void done(ParseException e) {
    if (e == null) {
      // Hooray! Let them use the app now.
    } else {
      // Sign up didn't succeed. Look at the ParseException
      // to figure out what went wrong
    }
  }

});

您可以在此处详细了解ParseUser:https://parse.com/docs/android/guide#users