欢迎来到天天文库
浏览记录
ID:40488607
大小:172.65 KB
页数:10页
时间:2019-08-03
《android拨号键盘设计》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、第二次作业效果图:代码:MainActivity.java:packagecom.example.myapplication;importandroid.content.Intent;importandroid.net.Uri;importandroid.provider.Contacts;importandroid.support.v7.app.ActionBar;importandroid.support.v7.app.AppCompatActivity;importandroid.os.Bundle;importandroid.view.View;im
2、portandroid.widget.Button;importandroid.widget.EditText;importandroid.widget.TextView;publicclassMainActivityextendsAppCompatActivity{TextViewTextt;Stringss="";Strings1="";@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.l
3、ayout.activity_main);ActionBaractionbar=getSupportActionBar();if(actionbar!=null){actionbar.hide();}}publicvoidonVVlick(Viewv){TextViewText1=(TextView)findViewById(R.id.Text1);TextViewText2=(TextView)findViewById(R.id.Text2);switch(v.getId()){caseR.id.one:Textt=(TextView)findViewBy
4、Id(R.id.one);ss+=Textt.getText().toString();Text1.setText(ss);Text2.setText(ss);break;caseR.id.two:Textt=(TextView)findViewById(R.id.two);ss+=Textt.getText().toString();Text1.setText(ss);Text2.setText(ss);break;caseR.id.three:Textt=(TextView)findViewById(R.id.three);ss+=Textt.getTe
5、xt().toString();Text1.setText(ss);Text2.setText(ss);break;caseR.id.four:Textt=(TextView)findViewById(R.id.four);ss+=Textt.getText().toString();Text1.setText(ss);Text2.setText(ss);break;caseR.id.five:Textt=(TextView)findViewById(R.id.five);ss+=Textt.getText().toString();Text1.setTex
6、t(ss);Text2.setText(ss);break;caseR.id.six:Textt=(TextView)findViewById(R.id.six);ss+=Textt.getText().toString();Text1.setText(ss);Text2.setText(ss);break;caseR.id.seven:Textt=(TextView)findViewById(R.id.seven);ss+=Textt.getText().toString();Text1.setText(ss);Text2.setText(ss);brea
7、k;caseR.id.eight:Textt=(TextView)findViewById(R.id.eight);ss+=Textt.getText().toString();Text1.setText(ss);Text2.setText(ss);break;caseR.id.nine:Textt=(TextView)findViewById(R.id.nine);ss+=Textt.getText().toString();Text1.setText(ss);Text2.setText(ss);break;caseR.id.xing:Textt=(Tex
8、tView)findViewById(R.id.xi
此文档下载收益归作者所有