本文整理匯總了Java中com.parse.ParseUser.setEmail方法的典型用法代碼示例。如果您正苦於以下問題:Java ParseUser.setEmail方法的具體用法?Java ParseUser.setEmail怎麽用?Java ParseUser.setEmail使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.parse.ParseUser
的用法示例。
在下文中一共展示了ParseUser.setEmail方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: cadastrarUsuario
import com.parse.ParseUser; //導入方法依賴的package包/類
private void cadastrarUsuario() {
//Cria objeto usuario
ParseUser usuario = new ParseUser();
usuario.setUsername(textoUsuario.getText().toString());
usuario.setEmail(textoEmail.getText().toString());
usuario.setPassword(textoSenha.getText().toString());
//salva dados do usuario
usuario.signUpInBackground(new SignUpCallback() {
@Override
public void done(ParseException e) {
if (e == null) {//sucesso ao salvar
Toast.makeText(CadastroActivity.this, "Cadastro feito com sucesso!",
Toast.LENGTH_LONG).show();
abrirLoginUsuario();
} else {//erro ao salvar
ParseErros parseErros = new ParseErros();
String erro = parseErros.getErro(e.getCode());
Toast.makeText(CadastroActivity.this, erro, Toast.LENGTH_LONG).show();
}
}
});
}
示例2: signUp
import com.parse.ParseUser; //導入方法依賴的package包/類
private void signUp(){
ParseUser user = new ParseUser();
user.setUsername(USER_NAME);
user.setPassword(PASSWORD);
user.setEmail(EMAIL);
user.signUpInBackground(new SignUpCallback() {
public void done(ParseException e) {
if (e == null) {
login();
Toast.makeText(getApplicationContext(), "Login cadastrado com sucesso", Toast.LENGTH_SHORT).show();
}else{
Toast.makeText(getApplicationContext(), "Erro ao cadastrar login", Toast.LENGTH_SHORT).show();
}
}
});
}
示例3: registerOnClick
import com.parse.ParseUser; //導入方法依賴的package包/類
public void registerOnClick(View v) {
name = userName.getText().toString();
pass = password.getText().toString();
mail = Mail.getText().toString();
if(name.length() < 4 || pass.length() < 6 || mail.length() == 0)
System.out.println("Something has fucked up");
final ParseUser user = new ParseUser();
user.setUsername(name);
user.setEmail(mail);
user.setPassword(pass);
System.out.println("Request sent");
user.signUpInBackground(new SignUpCallback() {
@Override
public void done(ParseException e) {
System.out.println("Got Response");
if(e == null) {
startActivity(new Intent(Register.this, UserList.class));
}
else e.printStackTrace();
}
});
}
示例4: connectToParse
import com.parse.ParseUser; //導入方法依賴的package包/類
public void connectToParse(){
Profiles profiles = Profiles.getInstance();
String loginUser = profiles.loginEmail.replace("@ualberta.ca", "");
//create new user
ParseUser userParse = new ParseUser();
userParse.setUsername(loginUser);
userParse.setPassword(loginUser);
userParse.setEmail(profiles.loginEmail);
userParse.signUpInBackground(new SignUpCallback() {
public void done(ParseException e) {
if (e == null) {
// Hooray! Let them use the app now.
initiateParse();
startApp();
} else {
// Sign up didn't succeed. Look at the ParseException
// to figure out what went wrong
login();
}
}
});
}
示例5: createAccount
import com.parse.ParseUser; //導入方法依賴的package包/類
@OnClick(R.id.saveNewAccount) void createAccount(View view) {
ParseUser parseUser = new ParseUser();
parseUser.setUsername(newUser.getText().toString());
parseUser.setEmail(newUser.getText().toString());
parseUser.setPassword(newPassword.getText().toString());
parseUser.put(Constants.PARSE_USER_ATTR_NAME, newName.getText().toString().trim());
parseUser.signUpInBackground(new SignUpCallback() {
public void done(ParseException e) {
if (e == null) {
// Hooray! Let them use the app now.
Log.e(LOG_TAG, "Hooray! Let them use the app now");
Toast.makeText(getApplicationContext(), "Hooray! Let them use the app now", Toast.LENGTH_SHORT).show();
handleAccountCreated();
} else {
// Sign up didn't succeed. Look at the ParseException
// to figure out what went wrong
Log.e(LOG_TAG, "Sign up didn't succeed. Look at the ParseException");
Toast.makeText(getApplicationContext(), "Sign up didn't succeed. Look at the ParseException", Toast.LENGTH_SHORT).show();
}
}
});
}
示例6: createUser
import com.parse.ParseUser; //導入方法依賴的package包/類
@OnClick(R.id.createAccountButton) void createUser(View view){
ParseUser parseUser = new ParseUser();
parseUser.setUsername(personName.getText().toString());
parseUser.setEmail(email.getText().toString());
parseUser.setPassword(password.getText().toString());
parseUser.signUpInBackground(new SignUpCallback() {
public void done(ParseException e) {
if (e == null) {
// Hooray! Let them use the app now.
Log.e(LOG_TAG, "Hooray! Let them use the app now");
Toast.makeText(getApplicationContext(), "Hooray! Let them use the app now", Toast.LENGTH_SHORT).show();
} else {
// Sign up didn't succeed. Look at the ParseException
// to figure out what went wrong
Log.e(LOG_TAG, "Sign up didn't succeed. Look at the ParseException");
Toast.makeText(getApplicationContext(), "Sign up didn't succeed. Look at the ParseException", Toast.LENGTH_SHORT).show();
}
}
});
}
示例7: register
import com.parse.ParseUser; //導入方法依賴的package包/類
@Override
public void register(String email, String username, String password, Bitmap profilePicture) {
final ParseUser user = new ParseUser();
user.setEmail(email);
user.setUsername(username);
user.setPassword(password);
if (profilePicture != null){
byte[] pfArray = getBytesFromBitmap(profilePicture);
final ParseFile file = new ParseFile("abc.png", pfArray);
file.saveInBackground();
file.saveInBackground(new SaveCallback() {
@Override
public void done(ParseException e) {
if (e == null){
user.put("photo", file);
signUpInBackground(user);
} else {
EventBus.getDefault().post(new RegisterCallbackEvent(false,e.getMessage()));
}
}
});
} else {
signUpInBackground(user);
}
}
示例8: signup
import com.parse.ParseUser; //導入方法依賴的package包/類
/**
* Creates a new user in the Parse backend using the provided credentials
*
* @param teamNumber the team number to signup to
* @param email the email of the user
* @param pass the password of the user account
*/
public void signup(final String teamNumber, final String email, String pass, final View view) {
if (!isNetworkAvailable()) {
Snackbar.make(view, "Unable to connect to the Internet. Try again.", Snackbar.LENGTH_SHORT).show();
return;
}
// Make sure all fields are filled in
if (teamNumber.equals("") || email.equals("") || pass.equals("")) {
Snackbar.make(view, "Please fill in all fields.", Snackbar.LENGTH_SHORT).show();
return;
}
// Create new ParseUser object to signup with field credentials
ParseUser user = new ParseUser();
user.setEmail(email);
user.setUsername(email);
user.setPassword(pass);
user.put("Team", teamNumber);
user.signUpInBackground(new SignUpCallback() {
@Override
public void done(ParseException e) {
// Signup was successful, no exception
if (e == null) {
Snackbar.make(view, "Successfully signed up.", Snackbar.LENGTH_SHORT).show();
sessionManager.createLoginSession(teamNumber, email);
startActivity(new Intent(getApplicationContext(), TeamListActivity.class));
finish();
} else {
Snackbar.make(view, "Unable signed up. Please try again.", Snackbar.LENGTH_SHORT).show();
password.setText("");
passwordAgain.setText("");
}
}
});
}
示例9: handleSignup
import com.parse.ParseUser; //導入方法依賴的package包/類
public void handleSignup(final View view)
{
showProgress();
ParseUser user = ParseUser.getCurrentUser();
user.setUsername(usernameText.getText().toString());
user.setPassword(passwordText.getText().toString());
user.setEmail(emailText.getText().toString());
user.saveInBackground(new SaveCallback()
{
public void done(ParseException e)
{
if (e == null)
{
// Hooray! Let them use the app now.
Ln.d("Hooray!");
handleLogin(view);
}
else
{
// Sign up didn't succeed. Look at the ParseException
// to figure out what went wrong
e.printStackTrace();
}
}
});
}
示例10: signup
import com.parse.ParseUser; //導入方法依賴的package包/類
public void signup() {
final Intent myintent = new Intent(getActivity(),HomePage.class);
if (!name.getText().toString().isEmpty() && !email.getText().toString().isEmpty() && !pass.getText().toString().isEmpty() && !repass.getText().toString().isEmpty() && pass.getText().toString().equals(repass.getText().toString()) && pass.getText().toString().length() >= 6)
{
ParseUser user = new ParseUser();
user.setUsername(email.getText().toString());
user.setPassword(pass.getText().toString());
user.setEmail(email.getText().toString());
user.put("Name",name.getText().toString());
user.signUpInBackground(new SignUpCallback() {
public void done(ParseException e) {
if (e == null) {
showSuccess("Please verify your email, then click the login button");
firebaseSignUp(email.getText().toString());
} else {
showIssue(e.toString());
}
}
});
}else if (name.getText().toString().isEmpty() || email.getText().toString().isEmpty() || pass.getText().toString().isEmpty() || repass.getText().toString().isEmpty()){
showIssue("Please makes sure you fill out all the fields properly!");
}else if(!pass.getText().toString().equals(repass.getText().toString())){
showIssue("Oops your passwords do not match, please try again");
}else if(pass.getText().toString().length()<6){
showIssue("Please make sure your password is at least six characters long");
}
}
示例11: onCreate
import com.parse.ParseUser; //導入方法依賴的package包/類
@Override
@SuppressWarnings("deprecation")
public void onCreate() {
Parse.initialize(this, "8FttRlqaAUPabxXzuLeTMbmgAA389L7oVbFaSqjj", "6sFwktakiPYSDg1NKzgP18yanSjlB9CQKFGUOShs");
// Also in this method, specify a default Activity to handle push notifications
PushService.setDefaultPushCallback(this, Notification.class);
// PushService.subscribe(this, "Everyone", Notification.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
ParseObject.registerSubclass(Message.class);
// ParsePush.subscribeInBackground("Giants");
ParseUser user = new ParseUser();
user.setUsername("caip");
user.setPassword("piacpiac");
user.setEmail("[email protected]");
ParseUser user_2 = new ParseUser();
user_2.setUsername("professor");
user_2.setPassword("prof_iprj");
user_2.setEmail("[email protected]");
user.signUpInBackground(new SignUpCallback() {
@Override
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
}
}
});
}
示例12: onClick
import com.parse.ParseUser; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
if(!validate()){
return;
}
// Check if password match
final String password = passwordField.getText().toString();
if(!password.equals(confirmPasswordField.getText().toString())){
confirmPasswordField.setError(MyApp.getAppContext().getString(R.string.passwordNotMatch));
confirmPasswordField.setText("");
confirmPasswordField.requestFocus();
return;
}
String username = usernameField.getText().toString();
String email = emailField.getText().toString();
ParseUser user = new ParseUser();
// Set standard fields
user.setUsername(username);
user.setPassword(password);
user.setEmail(email);
loadingStart();
user.signUpInBackground(new SignUpCallback() {
@Override
public void done(ParseException e) {
if (isActivityDestroyed()) {
return;
}
if (e == null) {
loadingFinish();
signupSuccess();
} else {
loadingFinish();
switch (e.getCode()) {
case ParseException.INVALID_EMAIL_ADDRESS:
showToast(R.string.invalidEmail);
break;
case ParseException.USERNAME_TAKEN:
showToast(R.string.usernameTaken);
break;
case ParseException.EMAIL_TAKEN:
showToast(R.string.emailTaken);
break;
default:
showToast(R.string.unknownSignupError);
}
}
}
});
}
示例13: clearFocusAndSubmit
import com.parse.ParseUser; //導入方法依賴的package包/類
private void clearFocusAndSubmit() {
View focussedView = getView().findFocus();
if (focussedView != null) focussedView.clearFocus();
List<String> validationErrors = new ArrayList<>();
//boolean passwordsOK = !StringUtils.isAnyNullOrEmpty(mPassword1) && mPassword1.length()>0;
//if(!passwordsOK) validationErrors.add("Passwords do not match");
final ParseUser parseUser = new ParseUser();
if (mCustomer.password==null || mCustomer.password.length()<CustomerHelper.MIN_PASSWORD_LENGTH)
validationErrors.add(String.format("A valid password is required of at least %d characters", CustomerHelper.MIN_PASSWORD_LENGTH));
else parseUser.setPassword(mCustomer.password);
String email = mCustomer.getEmail();
if(email!=null) {
parseUser.setEmail(email);
parseUser.setUsername(email);
}
parseUser.put("firstName", mCustomer.firstName);
parseUser.put("lastName", mCustomer.lastName);
validationErrors.addAll(CustomerHelper.validate(parseUser));
if(validationErrors.size()>0){
aq.id(R.id.validation).text(StringUtils.stringListToString(validationErrors, "\n", false));
}
else{
requestingCount=1;
onRequestingChanged();
aq.id(R.id.validation).text("");
parseUser.signUpInBackground(new SignUpCallback() {
@Override
public void done(ParseException e) {
requestingCount=0;
onRequestingChanged();
if (e != null) {
new AlertDialog.Builder(getActivity()).setMessage(e.getMessage()).setPositiveButton(R.string.ok, null).show();
} else {
if (ConnectedApp.DEBUG)
Toast.makeText(getActivity(), "Signup success", Toast.LENGTH_SHORT).show();
Session.getInstance().setCustomerHeader(parseUser, mCustomer.password);
// Intent intent = new Intent(getActivity(), PreferencesActivity.class);
// startActivity(intent);
// getActivity().finish();
}
}
});
}
}
示例14: onClick
import com.parse.ParseUser; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
ParseUser.logOut();
final View view = v; //creating an Intent or Toast requires a view casted as 'final'
switch (v.getId()){//identify what item was pressed
case R.id.switchToLoginBtn:
mCallback.onSwitchToLogin();
break;
case R.id.registerBtn:
//start building an alert dialog incase there was an issue with registration credentials
AlertDialog.Builder builder = new AlertDialog.Builder(fragmentContainer.getContext());
builder.setTitle(R.string.app_name);
builder.setPositiveButton(R.string.dialogConfirm, null);
String dialogMsg = "";
//sanitize and validate registration credentials before sending to parse
String EmailStr = emailTxt.getText().toString();
if (Objects.equals(nameTxt.getText().toString(), ""))
dialogMsg = getString(R.string.nameNotValid);
else if (EmailStr.length() <=7 ||
!EmailStr.substring(EmailStr.length() - 7).contains("gcc.edu"))
dialogMsg = getString(R.string.emailNotValid);
else if (!Objects.equals(passTxt.getText().toString(), passConfirmTxt.getText().toString()))
dialogMsg = getString(R.string.passwordsDontMatch);
else if (passTxt.getText().toString().length()<8)
dialogMsg = getString(R.string.passwordTooShort);
else if (!hasDigitsAndLetters(passTxt.getText().toString()))
dialogMsg = getString(R.string.passwordMissingCharacters);
//display dialog if there were any issues
if (dialogMsg != ""){
builder.setMessage(dialogMsg);
AlertDialog errorDialog = builder.create();
errorDialog.show();
break;
}
//create a ParseUser with the provided credentials
ParseUser user = new ParseUser();
user.put("friendlyName", nameTxt.getText().toString());
user.setUsername(emailTxt.getText().toString().toLowerCase());
user.setEmail(emailTxt.getText().toString());
user.setPassword(passTxt.getText().toString());
//dismiss keyboard
InputMethodManager imm = (InputMethodManager)getActivity()
.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
//show register dialog with progress spinner while Parse executes in the background
signUpDialog.show();
signUpTask = new SignUpTask(user, view,fragmentContainer.getContext());
signUpTask.execute();//attempt to signup in the background
break;
default:
break;
}
}