如題,我試過(guò)這樣:EditText edt = (EditText) findViewById(R.id.price);
float number = Float.valueOf(edt.getText().toString());但是應(yīng)用在設(shè)備和模擬器上都不加載,返回的信息是:"the application has stopped unexpectedly. please try again."并且如果我刪除了這一行:float number = Float.valueOf(edt.getText().toString());應(yīng)用就能加載了。應(yīng)該怎么辦?
轉(zhuǎn)換EditText到浮點(diǎn)型
ibeautiful
2019-03-22 19:15:51