0

I have an app with layout, layout-land, layout-sw600dp-land and layout-sw720-land. My app works normally with bigger screen but with smaller screen phones the app will crash when I rotate the phone. I used this code in my manifest and solve the crashing problem:

android:configChanges="orientation|screenSize"

App works fine with rotate, but its just show the layout and any land layouts will not show up. what to do? Thanks in advance

Trikaldarshiii
  • 11,174
  • 16
  • 67
  • 95
  • `android:configChanges="orientation|screenSize". This is a hack, and should not be used. You think you've fixed your problem but you haven't. Try calling your phone when your app is ringing, or change the region or one of the other ways for your activity to be destroyed and recreated. Instead, you should find and fix the cause of the problem and also learn about the Activity life cycle. – Simon Sep 22 '13 at 17:56
  • i might be good with xml, cause its easy, but in java i am like alice in wonderland, cause there are a lots of ways and there is no limit. can you give any tips. i have already saw the Activity life cycle. – user2513275 Sep 22 '13 at 18:05
  • You should learn Java. Then the life cycle callbacks would make sense. It is not possible to write a robust Android app, more complex than "Hello World", without understanding the life cycle. Unless you understand onCreate(), onStart(), onResume() and onPause(), the most common callbacks, you will waste a lot of time trying to find problems like the ones you have described. – Simon Sep 22 '13 at 18:09
  • where is the best place to start? – user2513275 Sep 22 '13 at 18:12
  • developer.android.com – Simon Sep 22 '13 at 18:22

0 Answers0