I want to calculate from 2 in开发者_StackOverflow社区put (2 EditText) which the value in EditText receive only int. How to code this?
Try adding android:numeric="decimal" to EditText
Use int myInt = Integer.parseInt("55"); Where 55 is the text that was entered in the edittext. If it is an integer in the text it will work; otherwise it will throw NumberFormatException if the string cannot be parsed as an integer value.
精彩评论