第一步:在activity_main.xml中添加TextView控件
第二步:使用findViewById()方法找到控件
public void Btn1_Click(View view){
TextView textView=(TextView)findViewById(R.id.textView1);
String str="-------->"+count;
textView.setText(str);
count++;
}
扫描二维码关注公众号,回复:
3930118 查看本文章