I am having trouble setting up landscape mode in my application.
I have a /res folder that contains a layout folder and a layout-land folder
layout
-----main.xml
layout-land
-----main.xml
My /layout-land/main.xml contains different UI elements than /layout/main.xml. How can I map each layout appropriately when the user has switched to landscape mode and vice versa?
I am basically displaying a full screen ImageView when the user switches to landscape mode. The ImageView will download an image from the internet and display it. Switching back to portrait, should simply go back to my portrait mode, which has a different set of UI components.
I get a crash when I switch to landscape mode:
because I can't get the id:
chartImageViewLandscape = (ImageView) this.findViewById(R.id.chartImageViewLandscape);
chartImageViewLandscape is in /layout-land/main.xml
How can I get a reference to this?