Exemplo n.º 1
0
 @Override
 public void onClick(View arg0) {
   if (mName.getText().length() == 0) {
     Toast.makeText(this, "Please enter a Name", Toast.LENGTH_SHORT).show();
   } else if (mEmail.getText().length() == 0) {
     Toast.makeText(this, "Please enter an Email", Toast.LENGTH_SHORT).show();
   } else {
     if (!validateEmail(mEmail.getText().toString())) {
       mEmail.setState(FormEditText.INVALID);
     } else {
       global.patient = new Patient(mName.getText().toString(), null, mEmail.getText().toString());
       mEmail.setState(FormEditText.VALID);
       Intent myIntent = new Intent();
       myIntent.setClassName("swin.rat.ui.doctor", "swin.rat.ui.doctor.BodyPointsActivity");
       startActivity(myIntent);
     }
   }
 }
Exemplo n.º 2
0
 // To check if any data will be lost if user exists screen
 private boolean hasGotData() {
   return mName.isEmpty();
 }