Home > Mobile >  Android Studio error, a great god see, response to a button event, according to the book compilation
Android Studio error, a great god see, response to a button event, according to the book compilation

Time:09-24

Public class MainActivity extends AppCompatActivity {

@ Override
Protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
The Button buttonRegister=(Button) the findViewById (R.i db uttonRegister);
ButtonRegister. SetOnClickListener (new View. An OnClickListener ()) {
@ Override
Public void onClick (View v) {
Intent Intent=new Intent (MainActivity. This, RegisterActivity. Class);
startActivity(intent);
}

});
}
}

CodePudding user response:

 
ButtonRegister. SetOnClickListener (new View. An OnClickListener () {
@ Override
Public void onClick (View v) {
Intent Intent=new Intent (MainActivity. This, TestActivity. Class);
startActivity(intent);
}
});
  • Related