android EditText设置不可写(转)
1.在xml中实现是很简单的事情,代码如下:
android:editable="false"
editText.setFilters(new InputFilter[] { new InputFilter() { public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { return source.length() < 1 ? dest.subSequence(dstart, dend) : ""; } } });