I have 2 actvities with a xml each but I don't know how to switch to the second page with a button.
Can someone send me the code for the MainActivitie.java please (for a button)
I currently use the findView and onClick
I have 2 actvities with a xml each but I don't know how to switch to the second page with a button.
Can someone send me the code for the MainActivitie.java please (for a button)
I currently use the findView and onClick
In your MainActivity use this code:
Intent intent = new Intent(MainActivity.this, Second.java);
startActivity(intent);
Please read about "Intents", I have added some links that will clear your concepts. Previously asked question Intent Types