I need to use my application in both landscape and portrait modes. So i have made two layouts for both modes in two folders folder-layout and folder-layout-land. Now when i turn the phone the layout is switching good but the same layout in landscape mode is not maintained when switching to portrait mode. Some other different layout is getting loaded.

Is there any solution for this. Please share. Thanks in advance.

有帮助吗?

解决方案

As you have done everything right to make 2 xml and keep int 2 folders.

i think you just need to write this with your activity declaration in Manifest

android:configChanges="orientation|keyboardHidden"

to handle to configuaration change

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top