Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Josh Gold
12,207 PointsIs it important and worth the effort to support landscape mode for Android programs?
I am probably just being lazy!
Nevertheless I am running into some interesting issues when switching between portrait and landscape. Namely, the state of my program is not preserved when I switch orientation. In other words, my program completely starts over from the beginning.
I found some information here: http://www.devahead.com/blog/2012/01/preserving-the-state-of-an-android-webview-on-screen-orientation-change/
For now I am going to just put this on my todo list :-)
3 Answers
Stephen Goodwin
5,479 PointsIt really depends on what you're making. Most of the time it is good idea. Sometimes like alot of games or maps or even some photo viewing apps just can't do both scapes very well. But if it isn't a month long task I would do it.
Josh Gold
12,207 PointsThat sounds reasonable Stephen. I found some information on how to preserve the program state when switching orientation, but I also have some major layout issues with landscape, so I am forcing portrait mode for now, and implementing other features and content.
Josh Gold
12,207 PointsI think this is the code I was looking for to save the state:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);