Android development-Tips (SET) and tips for android
1. For too many controls with similar functions and a large number, you can use the include method. In the implementation application, you can put the control into the List set.
Private void initView () {// TODO Auto-generated method stubpwd1 = (EditText) findViewById (R. id. pwd_et_6_1); pwd2 = (EditText) findViewById (R. id. pwd_et_6_2); pwd3 = (EditText) findViewById (R. id. pwd_et_6_3); pwd4 = (EditText) findViewById (R. id. pwd_et_6_4); pwd5 = (EditText) findViewById (R. id. pwd_et_6_5); pwd6 = (EditText) findViewById (R. id. pwd_et_6_6); list. add (pwd1); list. add (pwd2); list. add (pwd3); list. add (pwd4); list. add (pwd5); list. add (pwd6); for (int I = 0; I <list. size (); I ++) {list. get (I ). addTextChangedListener (watcher); list. get (I ). setOnKeyListener (delete );}}