From 01379c8f1a9e4548e63cffa518f02c2e079316a5 Mon Sep 17 00:00:00 2001 From: Nick Bradbury Date: Mon, 9 Feb 2015 13:21:46 -0500 Subject: [PATCH] Removed blogUrl param from showBlogPreview(), added new routines for following/unfollowing blogs & feeds --- .../org/wordpress/android/util/StringUtils.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/WordPressUtils/src/main/java/org/wordpress/android/util/StringUtils.java b/WordPressUtils/src/main/java/org/wordpress/android/util/StringUtils.java index eca31ffd169d..b0b574cb5eaa 100644 --- a/WordPressUtils/src/main/java/org/wordpress/android/util/StringUtils.java +++ b/WordPressUtils/src/main/java/org/wordpress/android/util/StringUtils.java @@ -275,4 +275,17 @@ public static int stringToInt(String s, int defaultValue) { return defaultValue; } } + + public static long stringToLong(String s) { + return stringToLong(s, 0L); + } + public static long stringToLong(String s, long defaultValue) { + if (s == null) + return defaultValue; + try { + return Long.valueOf(s); + } catch (NumberFormatException e) { + return defaultValue; + } + } } \ No newline at end of file