Android development-Tips (SET) and tips for android

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.