I am creating an app where it will store some data of any user, for example, could storage, where user can store files, photos etc. I have put option for sign up where user can sign up and create an account there. Now, I want to implement this, the user should get page by page input sign up pages, meaning, after clicking on sign up, an activity will open that one will be the 1st activity where user will see edit text and a next button, in edit text user will put name and press next button. after clicking next 2nd activity invoked and user can put DOB in edit text then press next, 3rd activity invoked and user can put email then next and then 4th activity user can put password and confirm password and press login and in 5th activity user will be in the homepage, just like creating an account in gmail app. I want a replica like that in my app. To store the signup details in server I have use parse platform server, and successfully implemented on my app, the code given below shows all the input details in the same page, so how can I bifurcate it into the page by page as I have mentioned above. here is the code:- user clicks on signup button
EditText edName, edEmail, edPassword, edConfirmPassword;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_signup);
edName = findViewById(R.id.edName);
edEmail = findViewById(R.id.edEmail);
edPassword = findViewById(R.id.edPassword);
edConfirmPassword = findViewById(R.id.edConfirmPassword);
}
public void signup(View view) { //signup button
if( TextUtils.isEmpty(edName.getText())){
edName.setError( "Name is required!" );
}else if( TextUtils.isEmpty(edEmail.getText())){
edEmail.setError( "Email is required!" );
}else if( TextUtils.isEmpty(edPassword.getText())){
edPassword.setError( "Password is required!" );
}else if( TextUtils.isEmpty(edConfirmPassword.getText())){
edConfirmPassword.setError( "Confirm password is required!" );
}else if(!edPassword.getText().toString().equals(edConfirmPassword.getText().toString())){
Toast.makeText(SignupActivity.this, "Passwords are not the same!", Toast.LENGTH_LONG).show();
}else{
final ProgressDialog progress = new ProgressDialog(this);
progress.setMessage("Loading ...");
progress.show();
ParseUser user = new ParseUser();
user.setUsername(edEmail.getText().toString().trim());
user.setEmail(edEmail.getText().toString().trim());
user.setPassword(edPassword.getText().toString());
user.put("name", edName.getText().toString().trim());
user.signUpInBackground(new SignUpCallback() {
@Override
public void done(ParseException e) {
progress.dismiss();
if (e == null) {
Toast.makeText(SignupActivity.this, "Welcome!", Toast.LENGTH_LONG).show();
Intent intent = new Intent(SignupActivity.this, HomeActivity.class);
startActivity(intent);
finish();
} else {
ParseUser.logOut();
Toast.makeText(SignupActivity.this, e.getMessage(), Toast.LENGTH_LONG).show();
}
}
});
}