Android provides a simple and practical TextUtils class for string processing. If you do not need to think about regular expressions when processing relatively simple content, try this in android. text. the TextUtils class has the following functions: whether it is a NULL Character static boolean isEmpty (CharSequence str) split String public static String [] split (String text, String expression ), android Development Network prompts you to take a closer look at the example String below. split () returns [''] when the string to be split is empty. this returns []. this does not remove any empty strings from the result. for example split ("a,") returns {"",""}. use the regular public static String [] split (String text, Pattern pattern) to split the String to determine whether the text TextUtils at the current position is valid. getCapsMode (CharSequence cs, int off, int reqModes) uses HTML to Encode this String static String TextUtils.html Encode (String s)
<span style="color:#ff0000;">if (!TextUtils.isEmpty(spUtil.getUserId())) {</span> Intent intent = new Intent(WelcomeActivity.this, MainActivity.class); startActivity(intent); } else { startActivity(new Intent(WelcomeActivity.this,
FirstSetActivity. class ));}