how to convert EditText control's value in to float value in android
im receiving some value from EditText control. and i want that valu开发者_运维技巧e for some calculation so i need to convert it to float value how can i do that?
i tried below But getting null pointer exception:
float ip1=Integer.getInteger(t1.getText().toString());
Any Soln?
Try this:
String str = t1.getText().toString();
Float ip1 = new Float(str);
System.out.println("Float value = "+ip1);
float ip1=new Float(t1.getText().toString());
精彩评论