Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Self-Destructing Message Android App Adding Users Using Parse.com Creating a New User on Parse

Am not understanding this question

This question is not clear to me, am not sure what the question requires

SignUpActivity.java
import android.app.Activity;
import android.util.Log;
import com.parse.ParseUser;
import com.parse.ParseException;
import com.parse.SignUpCallback;

public class SignUpActivity extends Activity {

    public static final String TAG = SignUpActivity.class.getSimpleName();

    protected SignUpCallback mSignUpCallback = new SignUpCallback() {
        @Override
        public void done(ParseException e) {

        }
    };

    // onCreate() and other code has been omitted

    protected void signUp(String username, String password) {
      ParseUser newUser=new ParseUser();
      newUser.setUsername(username);
      newUser.setPassword(password);


    }
}

1 Answer

You've got the user set up with a username and password - that all looks fine.

Next up, you need to use the callback that's already declared and call the signUpInBackground method:

    protected void signUp(String username, String password) {
      ParseUser newUser = new ParseUser();
      newUser.setUsername(username);
      newUser.setPassword(password);
      newUser.signUpInBackground(mSignUpCallback);
    }

Next, you need to log the error inside the done() method:

        public void done(ParseException e) {
          if(e == null){
           // success! 
          } else {
            Log.e(TAG, "ERROR");
          }         
        }

That should get you through it.

Steve.

Thanks Steve, that solved it