エディットテキストの文字を1つずつ削除したい。私はかなり研究しましたが、いくつかの問題があります、アドバイスしてください。これは私のサンプルコードです。
削除ボタンを作成しました"ImageButton buttonDelete;"// XML imageButton1
。編集テキストは"EditText display;"
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);