When using configChanges=keyboardHiden, layout-land not used

Search for BETA-testers and/or promote your own Application in a decent way.

When using configChanges=keyboardHiden, layout-land not used

Postby farha.ansari » Mon Feb 22, 2010 5:05 am

If we use android:configChanges="keyboardHidden|orientation", then when we switch from portrait to landscape mode, the xml layout is not taken from "layout-land" folder. Why? and, Is thr a way to do this?, bcos i have to make changes in my portrait layout for proper display in the switched landscape mode.

Thanks,
Farha
farha.ansari
Developer
Developer
 
Posts: 31
Joined: Mon Feb 22, 2010 4:38 am
Location: India

Top

Postby Boni2k » Mon Feb 22, 2010 10:36 am

Thats because your activity does not restart when you set the keyboardHidden part, thus Android does not rebuild your view using layout-land. In theory it you can make a workaround by using the onConfigurationChange method and set you content view to your layout-land file. But that's a theory, I didn't try it.
Boni2k
Experienced Developer
Experienced Developer
 
Posts: 88
Joined: Sun Dec 20, 2009 9:46 pm

Postby farha.ansari » Mon Feb 22, 2010 10:43 am

tht's the issue. I am using a webview, so if in onConfigurationChanged(), i set the layout, the page refreshes in the webview.
farha.ansari
Developer
Developer
 
Posts: 31
Joined: Mon Feb 22, 2010 4:38 am
Location: India

Postby Boni2k » Mon Feb 22, 2010 11:38 am

Another possibility is changing the existing layout in onConfigurationChanged by altering the views programmatically. Like changing LayoutParams etc. Bit more complicated, though.
Boni2k
Experienced Developer
Experienced Developer
 
Posts: 88
Joined: Sun Dec 20, 2009 9:46 pm

Top

Return to Promote your Android Application

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests