我需要做这样的事情:
name.setText("Text" + number1 "+" + number2);
为什么它在Android中不起作用?
改成这个name.setText(" Text " + number1 + " + " + number2);
两个数之和:name.setText(" Text " + number1 + " + " + number2 + " Sum :" + (number1+number2));
如果要将其显示为文本,则必须编写
name.setText("Text " + number1 + "+" + number2);
如果你想总结这两个数字,你必须写
name.setText("Text " + (number1+number2));