public void onAddContactTaskFinished(AddContactResponse response) {
    State state = State.ERROR;
    if (response == null) {
      state = State.ERROR;
    } else {
      Log.d("AddContactResponse", "AddContactResponse is: \n" + response.toString());
      if (response.isError()) state = State.FAILED;
      else {
        ContactStub contact_stub = response.getContact();
        contact_stub.setEmail(encryptor.decrypt(contact_stub.getEmail()));
        contact_stub.setName(encryptor.decrypt(contact_stub.getName()));
        if (contact_stub != null) {
          Contact contact = new Contact(contact_stub);
          if (db.insertContact(contact.toContentValues())) {
            state = State.SUCCESS;

          } else state = State.ERROR;
        } else state = State.FAILED;
      }
    }
    fragment.onAddContactTaskFinished(state);
  }
 public void onAddContactTaskFailed() {
   fragment.onAddContactTaskFailed();
 }
 public void onAddContactTaskStarted() {
   fragment.onAddContactTaskStarted();
 }