當前位置: 首頁>>代碼示例>>Java>>正文


Java SignUpCallback類代碼示例

本文整理匯總了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();
                }
            }
        });

    }
 
開發者ID:FilipeAlbuquerque,項目名稱:EletroFisio,代碼行數:26,代碼來源:CadastroActivity.java

示例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();
            }
        }
    });
}
 
開發者ID:rudsonlive,項目名稱:ParseLiveo,代碼行數:17,代碼來源:MainActivity.java

示例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();
        }
    });
}
 
開發者ID:getsadzeg,項目名稱:mtredi,代碼行數:23,代碼來源:Register.java

示例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();
            }
        }
    });
}
 
開發者ID:cfudge,項目名稱:ClassDiscuss,代碼行數:24,代碼來源:MainActivity.java

示例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);
            }
        });
    }
}
 
開發者ID:safakesberk,項目名稱:Cloud_Base-To-Do-App,代碼行數:22,代碼來源:LoginSignupActivity.java

示例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());
			}
		}
	});
}
 
開發者ID:maxml,項目名稱:AutoTimeHelper,代碼行數:23,代碼來源:UserAPI.java

示例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();
            }
        }
    });
}
 
開發者ID:dougritter,項目名稱:mirante,代碼行數:25,代碼來源:NewAccountActivity.java

示例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();
            }
        }
    });

}
 
開發者ID:dougritter,項目名稱:mirante,代碼行數:24,代碼來源:MainActivity.java

示例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());
            }
        }
    });
}
 
開發者ID:ghostling,項目名稱:Chirps,代碼行數:21,代碼來源:Admin.java

示例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();
            }
        }
    });
}
 
開發者ID:davidtavarez,項目名稱:codecampsdq4Parse,代碼行數:17,代碼來源:SignUpActivity.java

示例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);
      }
    }
  });
}
 
開發者ID:ixu,項目名稱:wallet,代碼行數:26,代碼來源:LoginActivity.java

示例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);
            }
        }
    });
}
 
開發者ID:INRIX-Iurii-Okhmat,項目名稱:ExpertAndroid,代碼行數:21,代碼來源:SignupActivity.java

示例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;
}
 
開發者ID:INRIX-Iurii-Okhmat,項目名稱:ExpertAndroid,代碼行數:27,代碼來源:SignupActivity.java

示例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()));
            }
        }
    });
}
 
開發者ID:Antpachon,項目名稱:RegLog,代碼行數:13,代碼來源:RegisterServiceParseImpl.java

示例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;
    }
}
 
開發者ID:whu-iss-jack,項目名稱:langren,代碼行數:39,代碼來源:UserNameActivity.java


注:本文中的com.parse.SignUpCallback類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。