5

I just noticed an strange behavior of EditText when doing a rotation. The text content gets duplicated!

I could reproduce the issue on my phone with gtalk too. Just start a new conversation, type anything on the EditText and then rotate your device. You will get a duplicate string in the rotated EditText. This only happens on first rotation.

Just to make sure it isn't only on my phone, I tested it on the emulator and it also duplicated the text content.

This only happens on 2.3.3+

I tried on a emulator with a 2.1 image and it works ok.

Can you confirm that?

Thanks in advance.

Francisco Junior
  • 1,986
  • 18
  • 25
  • 1
    duplicate: http://stackoverflow.com/questions/6005853/edittext-doubling-out-on-rotate – pjv Apr 28 '12 at 17:43

3 Answers3

3

This is an issue with the autocomplete from the Keyboard.

I've been having the same problem with the activity supporting orientation changes.

See edittext doubling

Community
  • 1
  • 1
0

Try using the AppCompat library and make your Activities extend AppCompatActivity.

Mr-IDE
  • 7,051
  • 1
  • 53
  • 59
0

this an application-specific bug. there must be a problem with the application's saving state process - remember that configuration change restarts your activity (goes through onStop - onRestart - onCreate). the app might have done something wrong while saving the EditText's state. EditTexts on other apps do not have the same problem.

josephus
  • 8,284
  • 1
  • 37
  • 57
  • At first I thought it was a problem of my application. But I tested it in the emulator with 2.1 rom and it works ok. Also, when I check in the debugger, the setText is being called just before my activity is being destroyed and I couldn't find who is calling the setText to cause this event to be raised. – Francisco Junior Nov 05 '11 at 14:34
  • i get that. doesn't matter where you test your application - emulator or whatever device. that's because the problem is with your APPLICATION. not your DEVICE. – josephus Nov 05 '11 at 17:44