I have a function which saves Android data in sqlite but I have to convert the String data to an Integer.
sqlite
String
Integer
Whenever the S
S
String str = "..."; // suppose str becomes null after some operation(s). int number = 0; try { if(str != null) number = Integer.parseInt(str); } catch (NumberFormatException e) { number = 0; }