Thanks got it, but the point still is that Android would not know that layout3 and layout1 are the same and so if i am in layout3 it will not switch to layout1 when an orientation change occurs, right?
On Sat, Oct 17, 2009 at 12:25 AM, Mark Murphy <[email protected]>wrote: > > Spektor Yaron wrote: > > by calling the layout-land "layout3" i loose the android built-in method > > to switch to it when the orientation changes. > > That is not what I wrote. > > Copy layout/layout1 to layout/layout3. Then, all three are available > under unique identifiers. > > You still have a landscape layout1 that would override the default > layout1 when the device is in landscape mode. > > > that is why i added a proposed solution for that - call the get > > getResources().getConfiguration().orientation myself and figure out > > which layout to switch to. are you saying it wouldn't work? > > No, I am saying having your own subdirectories under layout/ will not > work. I now realize that is not what you meant, and I apologize for my > error. > > You are welcome to: > > 1. Add android:configChanges="keyboardHidden|orientation" to the > <activity> element of the AndroidManifest.xml file for whatever activity > or activities you want. > > 2. Override onConfigurationChanged() in those activities -- that method > will be called when the configuration does change. > > 3. Do whatever you want to affect the orientation change (e.g., call > setContentView() on whatever layout suits your fancy). > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://twitter.com/commonsguy > > Android App Developer Books: http://commonsware.com/books.html > > > > -- Yaron Spektor --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

