Prioritize clarity rather than conciseness - Geisonszo/TecProg-Emergo GitHub Wiki

 deleteSecondContact.setOnClickListener(new View.OnClickListener() {

  public void onClick(View emergencyContactView) {

    deleteContact(nameSecondContact,phoneSecondContact,saveSecondContact,
            IDSECONDCONTACT,updateSecondContact,deleteSecondContact);

    saveSecondContact.setOnClickListener(new View.OnClickListener() {

      public void onClick(View emergencyContactView) {

        // For register the third emergency contact will done some validations and if on
        // validation not passed, will be given a chance to register the emergency contact
        // again
        if (signInSecondContact() == false) {

          saveSecondContact.setOnClickListener(new View.OnClickListener() {

            public void onClick(View emergencyContactView) {

              signInSecondContact();
              disableField(nameSecondContact,phoneSecondContact);
            } 
          });
        } else {

          disableSaveButton(saveSecondContact,updateSecondContact,
                  deleteSecondContact);
        }
      }
    });
  }
});