zoukankan      html  css  js  c++  java
  • Android中关于多个按钮放在一起操作的方法

    关于多个按键放在一起操作的方法:

    public class Sudoku extends Activity implements OnClickListener{
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            setContentView(R.layout.main);
         super.onCreate(savedInstanceState);      
                   
            View continueButton=this.findViewById(R.id.continue_button);
            continueButton.setOnClickListener(this);
            View newButton =this.findViewById(R.id.new_button);
            newButton.setOnClickListener(this);
            View aboutButton=this.findViewById(R.id.about_button);
            aboutButton.setOnClickListener(this);
            View exitButton=this.findViewById(R.id.exit_button);
            exitButton.setOnClickListener(this);
                  
        }  
        public void onClick(View v)
        {
         switch(v.getId()){
         case R.id.about_button:
          Intent i=new Intent(this,About.class);
          startActivity(i);
  • 相关阅读:
    vitual box 虚拟机调整磁盘大小 resize partiton of vitual os
    单向链表逆转
    搭建公司的React开发环境
    2018 ICPC 沈阳网络预赛 Fantastic Graph (优先队列)
    背包问题初探
    HDU 2588 GCD (欧拉函数)
    ZOJ
    ZOJ
    ZOJ
    HDU
  • 原文地址:https://www.cnblogs.com/yejiurui/p/3012668.html
Copyright © 2011-2022 走看看