1

In my application im going to display a web page in web view , it works fine but if i flip between landscape to portrait or vice versa, then it exits and comes to main page. wht is the prblm?

logcat:

03-10 13:35:47.123: INFO/WindowManager(69): Setting rotation to 1, animFlags=1
03-10 13:35:47.242: INFO/ActivityManager(69): Config changed: { scale=1.0 imsi=310/260 loc=en_US touch=3 keys=2/1/1 nav=3/1 orien=2 layout=17 uiMode=17 seq=70}
03-10 13:35:47.363: INFO/UsageStats(69): Unexpected resume of com.mireader while already resumed in com.mireader
03-10 13:35:50.413: DEBUG/dalvikvm(69): GC_EXPLICIT freed 395 objects / 20424 bytes in 195ms
Ted Hopp
  • 232,168
  • 48
  • 399
  • 521
vnshetty
  • 20,051
  • 23
  • 64
  • 102

1 Answers1

1

Since the device orientation is changing, the activity is destroyed then recreated.

This also leads the activity's contentview to be recreated.

See http://developer.android.com/reference/android/app/Activity.html#ConfigurationChanges for more details.

david
  • 1,311
  • 12
  • 32
  • http://developer.android.com/resources/articles/faster-screen-orientation-change.html "....it is sometimes confusing for new Android developers, who wonder why their activity is destroyed and recreated". – vnshetty Mar 10 '11 at 11:05
  • Yes all other platforms do not behave that way. However it is possible to handle the configuration change yourself. – david Mar 10 '11 at 15:43
  • 1
    @vnshetty See [link](http://stackoverflow.com/questions/456211/activity-restart-on-rotation-android) for this. – Giorgio Vespucci Mar 30 '11 at 08:26