It seems like your responseTime variable is null. So in first case int rTime = Integer.parseInt(responseTime);. you get NumberFormatException ...
stackoverflow.com