Skip to content

Instantly share code, notes, and snippets.

@pbrewczynski
Created December 8, 2013 21:57
Show Gist options
  • Save pbrewczynski/7864428 to your computer and use it in GitHub Desktop.
Save pbrewczynski/7864428 to your computer and use it in GitHub Desktop.
private int getIntFromEditText (EditText et) throws Exception {
try {
return Integer.parseInt(et.getText().toString());
} catch (NumberFormatException e) {
throw e; // because NumberFormatException describe my problem exactly
} catch (Exception e) {
throw e; // every other exception
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment