android.widget.Button cannot be cast to android.widget.EditText

前端 未结 4 872
轮回少年
轮回少年 2021-01-12 09:36

Developing my first Android calculator application, I succeeded in updating a TextView in a new activity by passing the answer via an intent, but this requires the user to h

4条回答
  •  执笔经年
    2021-01-12 10:22

    It seems like either R.id.number1 or R.id.number2 is a Button. Check your XML and make sure it's an EditText.

    Edit: Original answer didn't work, but cleaning the project solved the problem.

提交回复
热议问题