+ return getSelectedContact();
+ }
+
+ @Override
+ public String getQuestion() {
+ Contact contact = getSelectedContact();
+ String contactName = "null";
+ if (contact != null)
+ contactName = "" + contact.getPreferredDataValue("FN");
+
+ return Main.trans(
+ StringId.CONFIRM_USER_DELETE_CONTACT,
+ contactName);
+ }
+
+ @Override
+ public String callback(String answer) {
+ if (answer.equalsIgnoreCase("y")) {
+ Contact contact = getSelectedContact();
+ if (contact != null && contact.delete()) {
+ removeItem("x");
+ return null;
+ }
+
+ String contactName = "null";
+ if (contact != null)
+ contactName = "" + contact.getPreferredDataValue("FN");
+
+ return Main.trans(
+ StringId.ERR_CANNOT_DELETE_CONTACT,
+ contactName);
+ }
+
+ return null;