Error using onClickListener (Intent)

后端 未结 5 1341
無奈伤痛
無奈伤痛 2020-12-06 10:33

Well, I\'m trying to create an intent on a \"login.java\" the code is :

 Button btEntrar = (Button) findViewById(R.id.btnSingIn);
    btEntrar.setOnClickLis         


        
5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-06 10:55

    updated code in to your activity

    Button btEntrar = (Button) findViewById(R.id.btnSingIn);
     btEntrar.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent i;
            i = new Intent(login.this, MainActivity.class);
            startActivity(i);
    
    
        }
    });
    

提交回复
热议问题