public void formAction(BaseActivity activity, Forms form, boolean apply) { if (apply) { final String text = form.getTextFieldValue(TEXT); final String phone = getPhone(); if ((0 < text.length()) && (0 < phone.length())) { int agent = (0 < agents.indexOf('|')) ? form.getSelectorValue(AGENT) : 0; sendSms((Protocol) protocols.elementAt(agent), phone, text); } } form.back(); }
private String getPhone() { if (null != phones) { return form.getSelectorString(PHONE); } return form.getTextFieldValue(PHONE); }