私はAndroidスタジオの初心者で、2つの関数を使ってcalcでCボタンを作りたいと思います。 これを行うにはどうすればいいですか?1回のタップでCボタンで1つの数字だけが消去され、TextViewですべての数字が消去されますか?電卓に2つの機能Cボタンをプログラムするには?
findViewById(R.id.btnClear).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
txtScreen.setText(""); // Clear the screen
// Reset all the states and flags
lastNumeric = false;
stateError = false;
lastDot = false;
Aボタンを件名としますか?あなたはどう思いますか? – greenapps
これで、ロジックhttp://www.hackpundit.com/android-tutorial-simple-calculator-app/にお手伝いします。 – sushildlh
を10で割り、**商を**再びtextViewに入れます。あなたの番号の最後の数字を削除してください。 – sushildlh