EditText控间的运用
一、打勾显示输入的密码
?
private EditText et;private CheckBox cb;public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.password);et = (EditText)findViewById(R.id.editText1);cb = (CheckBox)findViewById(R.id.checkBox1);cb.setOnCheckedChangeListener(new OnCheckedChangeListener(){public void onCheckedChanged(CompoundButton buttonView,boolean isChecked) {if(cb.isChecked()){et.setTransformationMethod(HideReturnsTransformationMethod.getInstance());}else{et.setTransformationMethod(PasswordTransformationMethod.getInstance());}}});}?
?
?
mEditText1.addTextChangedListener(new TextWatcher(){public void afterTextChanged(Editable s) {}public void beforeTextChanged(CharSequence s, int start, int count,int after) {}public void onTextChanged(CharSequence s, int start, int before,int count) {}});?