0

orientation change is not working when I rotate a child activity to landscape. I added android:configChanges="orientation|keyboardHidden in all activity tags in my manifest.xml file.

I found that my app doesn't take layoyt file from layout_land folder. what is the solution for this problem.

URAndroid
  • 6,177
  • 6
  • 30
  • 40

1 Answers1

1

By putting that in your manifest you are saying that you will manually handle all orientation changes. You'll have to setContentView again onConfigurationChanged OR remove it from your manifest and it will load the right layout.

Edit: found this answer afterwards which explains it

Community
  • 1
  • 1
Ken Wolf
  • 23,133
  • 6
  • 63
  • 84
  • I removed onConfigurationChanged from menifest. But child activity still not working. when I change to landscape it goes to parentActivity. – URAndroid Jun 07 '13 at 05:02
  • Here is how to store and restore child fragment state: (http://stackoverflow.com/a/9646622/833647). You can also call `setRetainInstance(true);` in the `onCreate()` of your fragment (http://stackoverflow.com/a/11318942/833647) – Ken Wolf Jun 07 '13 at 05:38