The android.text.TextUtils.isEmpty(CharSequence str) consider a string containing only spaces NOT empty but we need an utility method returning true (it's empty) in those cases.
Solution:
Create our own StringUtils.isEmpty(CharSequence str) executing a str.trim() before calling android.text.TextUtils.isEmpty(str);
Replace all calls to android utility for our implementation.
The
android.text.TextUtils.isEmpty(CharSequence str)
consider a string containing only spaces NOT empty but we need an utility method returningtrue
(it's empty) in those cases.Solution:
StringUtils.isEmpty(CharSequence str)
executing astr.trim()
before callingandroid.text.TextUtils.isEmpty(str)
;