Skip to content

Commit

Permalink
Updating EditTextUtils.getText method instead of creating new one.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyr59h committed Jun 18, 2015
1 parent 9720b45 commit 349ced2
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.text.TextUtils;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.TextView;

/**
* EditText utils
Expand All @@ -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() : "";
}

/**
Expand Down

0 comments on commit 349ced2

Please sign in to comment.