1ANDROID通讯录3

 

1.

2.建立一个User类:包名:test.mycontract.entitypublicclassUser{publicint_id;publicintimageId;publicStringname;publicStringmobilePhone;publicStringofficePhone;publicStringfamilyPhone;publicStringposition;publicStringzipCode;publicStringemail;publicStringotherContact;publicStringremark;}

3.

4.在Activity中声明一组全局的控件变量EditTexttxtName;EditTexttxtComment;EditTexttxtEmail;EditTexttxtFamilyPhone;EditTexttxtMobilePhone;EditTexttxtOther;EditTexttxtOfficePhone;EditTexttxtPosition;EditTexttxtPostCode;ButtonbtnSave,btnReturn;给images数组添加一个默认图片(索引为0)R.drawable.ic_launcher,

5.编写一个初始化控件变量的方法publicvoidinitWidget(){txtName=(EditText)this.findViewById(R.id.txtName);txtComment=(EditText)this.findViewById(R.id.txtComment);txtEmail=(EditText)this.findViewById(R.id.txtEmail);txtFamilyPhone=(EditText)this.findViewById(R.id.txtFamilyPhone);txtMobilePhone=(EditText)this.findViewById(R.id.txtMobilePhone);txtOther=(EditText)this.findViewById(R.id.txtOfficePhone);txtOfficePhone=(EditText)this.findViewById(R.id.txtOther);txtPosition=(EditText)this.findViewById(R.id.txtPosition);txtPostCode=(EditText)this.findViewById(R.id.txtPostCode);btnSave=(Button)this.findViewById(R.id.btnSave);btnReturn=(Button)this.findViewById(R.id.btnReturn);}修改OnCreate方法publicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);

www.99jianzhu.com/包含内容:建筑图纸、PDF/word/ppt 流程,表格,案例,最新,免费下载,施工方案、工程书籍、建筑论文、合同表格、标准规范、CAD图纸等内容。


TOP最近更新内容

    长城小学关爱留守儿童工作制度
    园林史名词解释
  • 上一篇:聆听大师课堂 学习如沐春风
  • 下一篇:科学教育知识