设为首页 加入收藏

TOP

[APP] Android 开发笔记 004-Android常用基本控件使用说明(八)
2017-10-13 10:47:29 】 浏览:11593
Tags:APP Android 开发 笔记 004-Android 常用 基本 控件 使用说明
te Button btn_send;
         
            @Override
            protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.activity_main);
         
                cb_one = (CheckBox) findViewById(R.id.cb_one);
                cb_two = (CheckBox) findViewById(R.id.cb_two);
                cb_three = (CheckBox) findViewById(R.id.cb_three);
                btn_send = (Button) findViewById(R.id.btn_send);
         
                cb_one.setOnCheckedChangeListener(this);
                cb_two.setOnCheckedChangeListener(this);
                cb_three.setOnCheckedChangeListener(this);
                btn_send.setOnClickListener(this);
         
            }
         
            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
               if(compoundButton.isChecked()) Toast.makeText(this,compoundButton.getText().toString(),Toast.LENGTH_SHORT).show();
            }
         
             //统一监听
            @Override
            public void onClick(View view) {
                String choose = "";
                if(cb_one.isChecked())choose += cb_one.getText().toString() + "";
                if(cb_two.isChecked())choose += cb_two.getText().toString() + "";
                if(cb_three.isChecked())choose += cb_three.getText().toString() + &qu
首页 上一页 5 6 7 8 下一页 尾页 8/8/8
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Android---闪频页和倒计时 下一篇微信支付仅能成功调用一次的问题

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目