I want to change layout theme for my app. I design two layouts for one activity e.g. activity_main and activity_main2 for MainActivity.java. Now user will press Switch button 1st layout may go disappear and 2nd layout may go appear on Screen. Is it possible if yes kindly tell me how? This is my 1st layout which is set as default layout
This is my 2nd layout which is I want to replace with default layout on click on Switch button
If i using setContentView(R.layout.activity_main); and replace with setContentView(R.layout.activity_main2); on button click layout will change but i did'nt get widget's ids of 2nd layout. If anyone know kindly tell me