Package com.parse
Interface LogInCallback
-
public interface LogInCallback
ALogInCallback
is used to run code after logging in a user.The easiest way to use a
LogInCallback
is through an anonymous inner class. Override thedone
function to specify what the callback should do after the login is complete. Thedone
function will be run in the UI thread, while the login happens in a background thread. This ensures that the UI does not freeze while the save happens.For example, this sample code logs in a user and calls a different function depending on whether the login succeeded or not.
ParseUser.logInInBackground("username", "password", new LogInCallback() { public void done(ParseUser user, ParseException e) { if (e == null && user != null) { loginSuccessful(); } else if (user == null) { usernameOrPasswordIsInvalid(); } else { somethingWentWrong(); } } });
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
done(ParseUser user, ParseException e)
Override this function with the code you want to run after the save is complete.
-
-
-
Method Detail
-
done
void done(ParseUser user, ParseException e)
Override this function with the code you want to run after the save is complete.- Parameters:
user
- The user that logged in, if the username and password is valid.e
- The exception raised by the login, ornull
if it succeeded.
-
-