Converting a string to an integer on Android
See the Integer class and the static parseInt() method: http://developer.android.com/reference/java/lang/Integer.html You will need to catch NumberFormatException though in case of problems whilst parsing, so: