Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
バックスペースボタンを追加したい電卓を開発しています。バックスペース ボタンをクリックすると、要素がEditText1 つずつ削除されます。しかし、このコードの書き方がわかりません。解決策を提案してください。
EditText
このようなものが機能するはずです:
EditText edit; ... String txt = edit.getText(); txt = txt.length() > 1 ? txt.substring(0, txt.length() - 2) : "0"; edit.setText(txt);