Android examples for XML:XML Node
Convert XML String to Int with default value
//package com.java2s; public class Main { public static int toInt(String text, int defaultVal) { int value = defaultVal; try {//from w ww . j a va2 s.c om value = Integer.parseInt(text.trim()); } catch (Exception e) { } return value; } }