尝试做一个计算器,这里是带有 * 的行运行时的按钮方法,它出现错误“operator + cannot be applied to java.lang.charsequence”。如果有人知道解决此问题的方法,请提供帮助。
public void Button_Click(View view) {
TextView result = (TextView) findViewById(R.id.result);
Button b = (Button)view;
if ((result.getText() == "0")||(operation_pressed))
result.setText("");
operation_pressed = false;
if (b.getText() == ".") {
result.getText() = result.getText() + b.getText()); ***
}
}
谢谢