public static long parseLong ( String val , long defValue ) { if ( TextUtils . isEmpty ( val ) ) return defValue ; try { return Long . parseLong ( val ) ; } catch ( NumberFormatException e ) { return defValue ; } }
Parse a long from a String in a safe manner .