且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将EditText转换为int? (机器人)

更新时间:2023-11-19 12:48:04

你必须使用。

String value= et.getText().toString();
int finalValue=Integer.parseInt(value);

如果你只允许输入数字然后设置EditText属性。

if you have only allow enter number then set EditText property.

android:inputType="number"

如果这有用,那么接受另外发表评论。

if this is helpful then accept otherwise put your comment.