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

stage 2 challenge task 2

Now let's use the signUpInBackground() method to sign up this new user. For the SignUpCallback parameter, pass in the mSignUpCallback variable initialized in this Activity.

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);
      newUser.signUpInBackground(new SignUpCallback()); 
      }


    }
}

l have followed the instructions from the video but its not working please help ....thank you in advance

2 Answers

brian colliflower
brian colliflower
15,433 Points

the signUpInBackground(new SignUpCallback() is a method call not a statement it should look like this

     ParseUser newUser = new ParseUser();
      newUser.setUsername(username);
      newUser.setPassword(password);
    newUser.signUpInBackground(new SignUpCallback() {

    });

I just figured it out out it took me awhile too hope that helps.

You should pass in mSignUpCallback. Will look like this

newUser.signUpInBackground(mSignUpCallback);

jenyufu
jenyufu
3,311 Points

doesn't work