Solution 1 :
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
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
Comment posted by How to start new activity on button click
Does this answer your question?