TextUtils使用
public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); String str1 = ""; System.out.println(TextUtils.isEmpty(str1)); //为true String str2 = null; System.out.println(TextUtils.isEmpty(str2)); //为true } }