android: how to change layout on button click?

0 Marcin Beczynski · January 13, 2015
Hello Guys
I'm new on this forum so firstly I want to say hello to everyone :)
I try to build my new application and stuck on change layout on button click( I already created a nice graphic with some button and need to change layout from that button ) . FIst what I do is ask google and found this :    but it dont realy help me becouse it dont work could you please take a look on that and help me with creat this button 

thanks in advice :)

Post a Reply


Oldest  Newest  Rating
0 Nii Ayite Aryeh · January 14, 2015
Does the layout you want to change to come with its activity as well? If so you can just set an intent to take you to the activity of your new layout. for eg. you have with its layout activity.xml and you have another class with its layout second_activity.xml. You can move to your new layout using this code:

Intent in = new Intent(MainActivity.this, secondActivity.class);
  • 1

Java / Android Development


Very popular language used to create desktop applications, website applets, and Android apps.

Bucky Roberts Administrator