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
        
    }
}

 

posted @ 2016-01-18 11:26  wikiki  阅读(701)  评论(0编辑  收藏  举报