Creating multiple activity in Android

I am creating an application which has lots of buttons on home screen and upon clicking any button - opens new activity. I would like to know how to code for multiple activity from one single activity.

Comments

  • You can declare multiple activities in the AndroidManifest.xml. Switching between them would require you to select on which button has been pressed and startActivity based on that.
    Intent myIntent1 = new Intent(yourAppNamehere.this, theNextActivtyIwant.class);
        YourAppNameHere.this.startActivity(myIntent1);
    
  • You can declare multiple activities in the AndroidManifest.xml. Switching between them would require you to select on which button has been pressed and startActivity based on that.
    Intent myIntent1 = new Intent(yourAppNamehere.this, theNextActivtyIwant.class);
        YourAppNameHere.this.startActivity(myIntent1);
    

    Thank you. Got it. I was mixing it up with another activity code :)
Sign In or Register to comment.