• 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);
  • 相关阅读:
    UVa 1595
    求树直径及所有直径顶点

    python-sort()/sorted()比较
    MNIST数据集分类简单版本
    Tensorlflow-解决非线性回归问题
    Tensorlflow-神经网络解决非线性回归问题
    tensorflow基础-placeholder
    Tensorflow基础-mnist数据集
    Week 3: Structured Types 5. Tuples and Lists Exercise: odd tuples
  • 原文地址:https://www.cnblogs.com/yejiurui/p/3012668.html
Copyright © 2020-2023  润新知