我想将类型可编辑从一个
android编辑文本转换为类型整数,以对用户输入数字进行数学运算
我试过以下:
int x=(int)R2.getText().toString();
但它给我一个无法将字符串转换为int的错误.
解决方法
好的,我得到了答案:
int x = Integer.parseInt(R2.getText().toString());