How Do I Switch from One Android Activity to Another?
Contents

To do this Right click on the project you need to run->Run As->Android Application. Now your application fires up and you’ll get to see your first activity on Emulator screen. Now click on the button “Click to Navigate” to switch to next Activity. This is how you can achieve Navigation between Activities in Android.

How do I make another activity as main activity?

If you want to make Login activity your main activity then put the the intent-filter tag inside Login activity. Any activity your want to make your main activity must contain intent-filter tag with action as main and category as launcher.

How do you navigate from one activity to next activity give an example?

Create an intent to a ViewPerson activity and pass the PersonID (for a database lookup, for example). Intent i = new Intent(getBaseContext(), ViewPerson. class); i. putExtra(“PersonID”, personID); startActivity(i);

David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article
Twitter Facebook Pinterest