fun add(num1: EditText, num2: EditText){
try {
num1.toString().toInt()
num2.toString().toInt()
answer.setText((num1 + num2).toString())
} catch (e: NumberFormatException) {
answer.text = "Input Error"
}
}
I'm trying to make an integer calculator and have a problem.
answer.setText((num1 + num2).toString())
Here the addition symbol is highlighted in red. The text of the error is huge. What could be the problem?