Android App Development ||Move From One Activity To Another On Button Click - Passionate Geekz

Breaking

Where you can unleash your inner geek.

Monday, 24 June 2019

Android App Development ||Move From One Activity To Another On Button Click

In Previous Example we learn Change Button  Color On Click  after Changing the color now we learn to Change Activity or move from one activity On Button Click

The Output Will be look like this

In this guide or upcoming i will not show you how to setup and all stuff . i am pretending that you have downloaded the android studio and ready to start with your first android app.

  • Create android project and named it as Change_Activity .
  • Choose target android versions  and add an activity
  • Always Generate layout file This habit will help  you in  future

we want when we press then Button the new page or new activity will be open ,when you create your project you will get two files

  • java class file
  • layout file

Start with Your Layout Files

Your Activity_main.xml I have Added a Button 

Now Open Your MainActivity.class and add Button Method and Set Onclicklistener Method On Button

 

Now Create Multiple Activities Right Click On java Folder Select New Scroll To Activity and Create Multiple  Empty Activity or Any using Same Methods .

 

 

 

 

 

No comments:

Post a Comment