EditText is losing users' input when rotating android phone?

Add android:configChanges="orientation" to your activity in the androidmanifest.xml. This will rotate the orientation but make no changes occur on orientation change.

1 I was going to say "yeah that's what I have" and after I read up on onConfigurationChanged() I noticed that it's not necessary to use setContentView(R.layout. Chat). I've been doing it wrong for 6 months!

– Someone Somewhere Apr 14 at 3:40 but I wonder what I would do when I want a different view for landscape mode. Possibly use onRetainNonConfigurationInstance() and getLastNonConfigurationInstance() for data stored in the EditText – Someone Somewhere Apr 14 at 3:45 you can specify different xml files per orientation in their own folder with /res/layout-port/main. Xml or /res/layout-land/main.

Xml – corey Apr 14 at 21:26 I don't think my two methods are compatible though. Ive never tested it that way. If youd want to implement the above xml question with your original question, the solution would be saving data between the pre-orientation change activity's onDestroy() and the post-orientation change activity's onCreate().

I don't recall at the moment if variable instances are preserved across this timespan, if not then a solution with preferences or internal data storage may have to be coded – corey Apr 14 at 21:36.

You would have to use bundle to save instance states and such, check out this discussion about roughly the same topic and I'm sure you'll figure it out! Cheers!

I see that onSaveInstanceState() is the event I need, but unfortunately when the screen is rotated the resulting onConfigurationChanged() provides a Configuration type, instead of a Bundle. It would have been awesome if onConfigurationChanged() provided a Bundle instead :-( – Someone Somewhere Apr 14 at 3:22.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions