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 trialMUZ140118 Cathrine Makuya
10,300 Pointsstage 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.
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());
}
}
}
2 Answers
brian colliflower
15,433 Pointsthe 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.
Jery Althaf
5,818 PointsYou should pass in mSignUpCallback. Will look like this
newUser.signUpInBackground(mSignUpCallback);
jenyufu
3,311 Pointsdoesn't work
MUZ140118 Cathrine Makuya
10,300 PointsMUZ140118 Cathrine Makuya
10,300 Pointsl have followed the instructions from the video but its not working please help ....thank you in advance