I have a quick question.
I have a screen with some numbers, when you click one of the numbers, the number is added to the end of the edittext.
input.append(number);
I also have a tray, when the user clicks on this button, I want to delete the last character.
At the moment I have the following:
Editable currentText = input.getText();
if (currentText.length() > 0) {
currentText.delete(currentText.length() - 1,
currentText.length());
input.setText(currentText);
}
Is there an easier way to do this? Is there something in the input.remove () line?
source
share