setTextField(fieldName, newValue, characterCount == 0);
setTextField(fieldName, newValue, characterCount == 0, true);
void onVerify(Event event) {	if (ignoreVerify) return;	event.doit = false;	int fieldName = fieldNames[currentField];	int start = fieldIndices[currentField].x;	int end = fieldIndices[currentField].y;	int length = end - start;	String newText = event.text;	if (fieldName == Calendar.AM_PM) {		if (newText.equalsIgnoreCase("A") || newText.equalsIgnoreCase("AM")) {			setTextField(fieldName, Calendar.AM, true);		} else if (newText.equalsIgnoreCase("P") || newText.equalsIgnoreCase("PM")) {			setTextField(fieldName, Calendar.PM, true);		}		return;	}	if (characterCount > 0) {		newText = "" + text.getSelectionText() + newText;	}	int newTextLength = newText.length();	characterCount = (newTextLength < length) ? newTextLength : 0;	try {		int max = calendar.getActualMaximum(fieldName);		int min = calendar.getActualMinimum(fieldName);		int newValue = Integer.parseInt(newText);		if (min <= newValue && newValue <= max) {			setTextField(fieldName, newValue, characterCount == 0);		} else {			if (newTextLength >= length) {				newText = newText.substring(newTextLength - length + 1);				newValue = Integer.parseInt(newText);				characterCount = length - 1;				if (min <= newValue && newValue <= max) {					setTextField(fieldName, newValue, characterCount == 0);				}			}		}	} catch (NumberFormatException ex) {	}}