0
I’m developing an Android APP, in it you type some values in Edittext. But when you turn the phone to change the orientation the Edittext data is lost. How do I resolve?
0
I’m developing an Android APP, in it you type some values in Edittext. But when you turn the phone to change the orientation the Edittext data is lost. How do I resolve?
1
Use put methods to store values in onSaveInstanceState:
protected void onSaveInstanceState(Bundle extra) {
super.onSaveInstanceState(extra);
extra.putString("text", "your text here");
}
And restore in onCreate:
public void onCreate(Bundle extra) {
if (extra != null) {
String value = extra.getString("text");
}
}
Finally, remove from the manifest android:configChanges="orientation|keyboardHidden"
Browser other questions tagged android
You are not signed in. Login or sign up in order to post.
Hi Leandro. Post your code so we can help
– Evilmaax