-1

in my application result displayed in Text view is disappeared when mobile orientation is changed,for this what can i do.i want my application in both modes means portrait and landscape.for this what can i do.Give me some suggestions.Thanks in advance

Pinki
  • 21,723
  • 16
  • 55
  • 88
  • You really need to read the docs about the activity lifecycle. See http://stackoverflow.com/questions/151777/how-do-i-save-an-android-applications-state for a specific answer. – Rich Schuler Jun 21 '10 at 05:09

3 Answers3

1

That happens because activity is recreated when origientation changes, to avoid this you can use Jorgesys Answer, thats if your min Api level is < 13, if is older, you use screenSize too , by other side, if you want to handle it, you work with savedIntance Bundle.

Sergio A.
  • 101
  • 3
1

Hi Sairam something fast to avoid that

set in your app activity

      android:configChanges="keyboardHidden|orientation"            
Jorgesys
  • 124,308
  • 23
  • 334
  • 268
0

This is a little dated but has some links in it that should still be very valuable for you.

See: Android - switching between landscape and portrait mode makes Intent lose values

Community
  • 1
  • 1
Quintin Robinson
  • 81,193
  • 14
  • 123
  • 132