I’m making an android app in which the controls cannot be fit in one page. I have created a new XML file with the remainder of controls. Currently I’m trying to switch between the pages like this:
setContentView(R.layout.main);
// initialize controls on main page
setContentView(R.layout.page2);
// initialize controls on second page
However I can’t set or alter any of the controls on second page (no error is generated when trying to access those controls either). Is it necessary to make a new activity class for the second page?
If you need additional info to be provided, please comment it and I’ll provide it.
If you want to have multiple “pages” in one activity, have a look at
ViewFlipperclass. You can have two layouts representing two “pages” in one ViewFlipper parent – and then switch between the two.