Search code examples
androidonconfigurationchanged

Android app crashes on screen orientation change


I'm developing an application which will support multiple screens. I have created three layouts (large, small, medium). I'm testing it. I have two screens sign in and sign up.

In sign in it is working fine. But when I click on sign up button then I go to sign up page and if I'm in portrait mode and changes the mode the app gets crashed and there is no something like crash report in the logcat as well.


Solution

  • If you have not added any code like android:configChanges="orientation|keyboardHidden" to your manifest, your current activity (sign up?) will restart if you change the mode. It could be that you cannot restart the activity at that point because not all the info will be available for the activity.

    (btw: your question is not completely clear, but I gather that if you change mode (portrait/landscape) in a certain activity your application crashes)