2024年5月7日发(作者:)
private void setEditTextClear() {
// TODO Auto-generated method stub
((EditText)findViewById(.
login_username
)).addTextChangedListener(new TextWatcher() {
public void onTextChanged(CharSequence s, int start, int before, int count) {
// TODO Auto-generated method stub
if (TextUtils.
isEmpty
(s)) {
findViewById(.
login_username_clear
).setVisibility(View.
INVISIBLE
);
}else {
findViewById(.
login_username_clear
).setVisibility(View.
VISIBLE
);
}
Log.
i
("username", "");
}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
// TODO Auto-generated method stub
Log.
i
("username", "");
}
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
Log.
i
("username", "");
}
});
((EditText)findViewById(.
login_password
)).addTextChangedListener(new TextWatcher() {
public void onTextChanged(CharSequence s, int start, int before, int count) {
// TODO Auto-generated method stub
if (TextUtils.
isEmpty
(s)) {
findViewById(.
login_password_clear
).setVisibility(View.
INVISIBLE
);
发布评论