本文整理匯總了Java中com.parse.SignUpCallback類的典型用法代碼示例。如果您正苦於以下問題:Java SignUpCallback類的具體用法?Java SignUpCallback怎麽用?Java SignUpCallback使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SignUpCallback類屬於com.parse包,在下文中一共展示了SignUpCallback類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: cadastrarUsuario
import com.parse.SignUpCallback; //導入依賴的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.SignUpCallback; //導入依賴的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.SignUpCallback; //導入依賴的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.SignUpCallback; //導入依賴的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: signup
import com.parse.SignUpCallback; //導入依賴的package包/類
private void signup(String usernametxt, String passwordtxt) {
if (!isEmpty()){
int numberParse = 0;
ParseQuery<ParseUser> numberofUsers = ParseUser.getQuery(); // Note to myself : count users in parse class
try {
numberParse=numberofUsers.count();
} catch (ParseException e1) {
e1.printStackTrace();
}
user = new ParseUser();
user.setUsername(usernametxt);
user.setPassword(passwordtxt);
user.put("userID",numberParse+1);
user.signUpInBackground(new SignUpCallback() {
public void done(ParseException e) {
checkSignup(e);
}
});
}
}
示例6: create
import com.parse.SignUpCallback; //導入依賴的package包/類
public void create(User user) {
Log.d("User", "start method create in UserCRUD");
ParseUser usr = new ParseUser();
usr.put(USERNAME, user.getUsername());
usr.put(PASSWORD, user.getPassword());
usr.put(EMAIL, user.getEmail());
Log.d("User", user.getUsername());
usr.signUpInBackground(new SignUpCallback() {
@Override
public void done(ParseException e) {
if (e == null) {
Log.d("User", "h send empty message");
handler.sendEmptyMessage(CONNECTION_OK);
Log.d("User", "h = 1");
} else {
handler.sendEmptyMessage(0);
Log.d("User", "exception" + e.toString());
}
}
});
}
示例7: createAccount
import com.parse.SignUpCallback; //導入依賴的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();
}
}
});
}
示例8: createUser
import com.parse.SignUpCallback; //導入依賴的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();
}
}
});
}
示例9: Admin
import com.parse.SignUpCallback; //導入依賴的package包/類
public Admin(String username, String password, String email) {
// Create a basic user.
ParseUser adminUser = new ParseUser();
adminUser.setUsername(username);
adminUser.setPassword(password);
adminUser.setEmail(email);
adminUser.signUpInBackground(new SignUpCallback() {
@Override
public void done(ParseException e) {
if (e == null) {
Log.i("Admin User Creation", "Account creation for username success!");
// Associate with role only when account is created successfully.
associateRole();
} else {
Log.e("Admin User Creation", e.getMessage());
}
}
});
}
示例10: doSignUp
import com.parse.SignUpCallback; //導入依賴的package包/類
public void doSignUp(View view) {
ParseUser user = new ParseUser();
user.setUsername(((EditText) findViewById(R.id.etSignUpUser)).getText().toString());
user.setPassword(((EditText) findViewById(R.id.etSignUpPassword)).getText().toString());
user.setEmail(((EditText) findViewById(R.id.etSignUpEmail)).getText().toString());
user.signUpInBackground(new SignUpCallback() {
public void done(ParseException e) {
if (e == null) {
startActivity(new Intent(mContext, MyActivity.class));
} else {
Toast.makeText(mContext,e.getMessage(),Toast.LENGTH_LONG).show();
}
}
});
}
示例11: handleSignUp
import com.parse.SignUpCallback; //導入依賴的package包/類
/**
* Signs the user up with the provided info. If signup succeeds,
* you should call finishSuccessfulLoginOrSignup() to close this
* screen. If signup fails, you should call showSignupFailedToast();
* @param email
* @param password
*/
private void handleSignUp(String email, String password) {
ParseUser user = new ParseUser();
user.setUsername(email);
user.setPassword(password);
user.setEmail(email);
user.signUpInBackground(new SignUpCallback() {
@Override
public void done(ParseException e) {
if (e == null) {
Log.d(TAG, "Successfully signed up");
finishSuccessfulLoginOrSignup();
} else {
Log.d(TAG, "Signup failed: " + e.getMessage());
showSignupFailedToast(e);
}
}
});
}
示例12: signup
import com.parse.SignUpCallback; //導入依賴的package包/類
private void signup(String userId, String email, String password) {
ParseUser user = new ParseUser();
user.setUsername(userId);
user.setEmail(email);
user.setPassword(password);
this.turnOnProgressDialog("Signup", "Please wait while we sign you up");
user.signUpInBackground(new SignUpCallback() {
@Override
public void done(ParseException e) {
turnOffProgressDialog();
if (e == null) {
signupSuccessful();
} else {
signupFailed(e);
}
}
});
}
示例13: signup
import com.parse.SignUpCallback; //導入依賴的package包/類
private void signup(String userid, String email, String password)
{
ParseUser user = new ParseUser();
user.setUsername(userid);
user.setPassword(password);
user.setEmail(email);
//Show the progress dialog
turnOnProgressDialog("Signup", "Please wait while we sign you up");
//Go for signup with a callback
user.signUpInBackground(new SignUpCallback() {
public void done(ParseException e) {
turnOffProgressDialog();
if (e == null) {
// Hooray! Let them use the app now.
signupSuccessful();
} else {
// Sign up didn't succeed. Look at the ParseException
// to figure out what went wrong
signupFailed(e);
}
}
});
return;
}
示例14: signUpInBackground
import com.parse.SignUpCallback; //導入依賴的package包/類
public void signUpInBackground(ParseUser user){
user.signUpInBackground(new SignUpCallback() {
@Override
public void done(ParseException e) {
if (e == null) {
EventBus.getDefault().post(new RegisterCallbackEvent(true,null));
} else {
EventBus.getDefault().post(new RegisterCallbackEvent(true,e.getMessage()));
}
}
});
}
示例15: onClick
import com.parse.SignUpCallback; //導入依賴的package包/類
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.next://注冊頁麵的 賬號及密碼 保存到數據庫
final String username = game_number.getText().toString();
final String password = game_password.getText().toString();
final String nickname = game_name.getText().toString();
final UserInfo user = new UserInfo();
user.setUsername(username);
user.setPassword(password);
user.put("nickname",nickname);
user.signUpInBackground(new SignUpCallback() {
@Override
public void done(ParseException e) {
if(e!=null){
e.printStackTrace();
Toast.makeText(UserNameActivity.this, "注冊失敗"+" code:"+e.getCode(), Toast.LENGTH_SHORT).show();
}else{
Intent intent = new Intent(UserNameActivity.this, UserHeadActivity.class);
startActivity(intent);
SoundEffectManager.play(R.raw.complete);
finish();
}
}
});
break;
case R.id.showPassword://點擊顯示密碼
if (click) {
game_password.setTransformationMethod(null);//顯示密碼
click = false;
} else {
game_password.setTransformationMethod(PasswordTransformationMethod.getInstance());//隱藏密碼
click = true;
}
break;
}
}