In pre launch reports for Android, I am getting the following error. While watching the recording it looks like when the bot selects a value it crashes but I cannot replicate the issue. Let me know if you need more information. How can I resolve this error?
07-27 01:48:35.765: E/AndroidRuntime(14892): java.lang.IndexOutOfBoundsException: setSpan (4 ... 4) ends beyond length 0
07-27 01:48:35.765: E/AndroidRuntime(14892): at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1096)
07-27 01:48:35.765: E/AndroidRuntime(14892): at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:671)
07-27 01:48:35.765: E/AndroidRuntime(14892): at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:664)
07-27 01:48:35.765: E/AndroidRuntime(14892): at android.text.Selection.setSelection(Selection.java:76)
07-27 01:48:35.765: E/AndroidRuntime(14892): at android.text.Selection.setSelection(Selection.java:87)
07-27 01:48:35.765: E/AndroidRuntime(14892): at android.widget.EditText.setSelection(EditText.java:98)
07-27 01:48:35.765: E/AndroidRuntime(14892): at android.widget.EditText.performAccessibilityActionInternal(EditText.java:138)
07-27 01:48:35.765: E/AndroidRuntime(14892): at android.view.View.performAccessibilityAction(View.java:8892)
07-27 01:48:35.765: E/AndroidRuntime(14892): at android.widget.NumberPicker$AccessibilityNodeProviderImpl.performAction(NumberPicker.java:2472)
The number picker is set up this way
numberPicker.setMaxValue(stringArrayOfCurrentPickerViewArray.length - 1);
numberPicker.setMinValue(0);
numberPicker.setDisplayedValues(stringArrayOfCurrentPickerViewArray);
numberPicker.setWrapSelectorWheel(false);
numberPicker.setSaveFromParentEnabled(false);
numberPicker.setSaveEnabled(true);
And when a value is selected
int row = numberPicker.getValue();
if (row != 0) {
if (row > 0 && row <= stringArrayOfCurrentPickerViewArray.length - 1) {
textField.setText(stringArrayOfCurrentPickerViewArray[row]);
}
}