From 349ced2fe50ca19beb808dfee873bc1df3803cbe Mon Sep 17 00:00:00 2001 From: Tony Rankin Date: Thu, 18 Jun 2015 14:18:18 -0700 Subject: [PATCH] Updating EditTextUtils.getText method instead of creating new one. --- .../java/org/wordpress/android/util/EditTextUtils.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/WordPressUtils/src/main/java/org/wordpress/android/util/EditTextUtils.java b/WordPressUtils/src/main/java/org/wordpress/android/util/EditTextUtils.java index 64ee67e566a9..66a0c77fdf8f 100644 --- a/WordPressUtils/src/main/java/org/wordpress/android/util/EditTextUtils.java +++ b/WordPressUtils/src/main/java/org/wordpress/android/util/EditTextUtils.java @@ -4,6 +4,7 @@ import android.text.TextUtils; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; +import android.widget.TextView; /** * EditText utils @@ -14,13 +15,10 @@ private EditTextUtils() { } /** - * returns text string from passed EditText + * returns non-null text string from passed TextView */ - public static String getText(EditText edit) { - if (edit.getText() == null) { - return ""; - } - return edit.getText().toString(); + public static String getText(TextView textView) { + return (textView != null) ? textView.getText().toString() : ""; } /**