The first method is relatively simple and common ~ Because I have developed such things:
CodeAs follows;
Public class actjava extends activity {
Public void oncreate (bundle savedinstancestate ){
Super oncreate (savedinstancestate );
Setcontentview (R. layout. Main );
Button button = (button) This. findviewbyid (R. layout. button1 );
Button, setonclicklistener (New onclicklistener {
@ Override
Public void onclick (view v ){
Setcontentview (R. layout. **) // *** the interface name you want to go
}
}
);
}
}
The second method code is different from the first one. · As long as you understand it, you just need to call one more class to implement it. · depending on the situation. · the second method is also required. mastered
Public class actjava extends activity {
Public void oncreate (bundle savedinstancestate ){
super oncreate (savedinstancestate);
setcontentview (R. layout. main);
button = (button) This. findviewbyid (R. layout. button1);
button, setonclicklistener (New onclicklistener {
@ override
Public void onclick (view v) {
intent inten = new intent (actjava. this ,****. class) // **** the interface name you want to go to
startactivity (intent);
}< BR >}< br> );
}< BR >}< br> you also need to register the class to androidmanifest. in XML. Otherwise, you will find that the implementation cannot be run.
after the original activity ends, add a line.
Android: Name = ". * ******* "