title: Delete or backspace function. I created a button but cannot do a delete/backspace in my edittext
body: <p>I want to delete the characters in my edittext one by one. I've research quite a bit but there are some problems, please advise. this is my sample code.</p>
  
  <p>I created a delete button <code>"ImageButton buttonDelete;"// XML imageButton1</code>
  and my edittext is <code>"EditText display;"</code></p>
  
  <pre><code>display = (EditText) findViewById(R.id.editText1);
          buttonDelete.setOnClickListener(new View.OnClickListener()
          {
               public void onClick() 
               {
                 // Get edit text characters
                  String textInBox = display.getText():
                  //Remove last character//
                  String newText = textInBox.substring(0, textInBox.length()-1);
                  // Update edit text
                  display.setText(newText);
  </code></pre>