zoukankan      html  css  js  c++  java
  • 每日日报20211 3/20

    今天的我得交我的个人作业了。或者我还可以拖两天?

    我觉得我得拖两天。

    public class MainActivity extends AppCompatActivity implements View.OnClickListener,CompoundButton.OnCheckedChangeListener{
    
        private CheckBox cb_one;
        private CheckBox cb_two;
        private CheckBox cb_three;
        private 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() + "";
            Toast.makeText(this,choose,Toast.LENGTH_SHORT).show();
        }
    }

     

  • 相关阅读:
    字符串匹配的三种算法
    字符串匹配
    多少个矩形被覆盖
    指针和地址的区别
    股票开盘的最大成交额-----一道不错的贪心算法题目
    Z字形扫描矩阵
    第几次出现
    节日(CCF试题)
    数字排序
    JS对象添加新的字段
  • 原文地址:https://www.cnblogs.com/song-1/p/14851543.html
Copyright © 2011-2022 走看看