Reputation: 679
From my main activity I open an intent with textboxes to edit data, but on screen rotation the opened intent closes and leaves only the starting activity. How should I handle it so that my secondary intent is not closed on screen rotation.
Upvotes: 0
Views: 110
Reputation: 4569
Add android:configChanges="orientation|keyboardHidden|screenSize"
in your activity declaration in AndroidManifest.xml
file
or handle you data in
@Override
protected void onSaveInstanceState(Bundle outState) {
// store the data in bundle
super.onSaveInstanceState(outState);
}
and restore the data in
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
// restore the data from bundle and settext to edittext
super.onRestoreInstanceState(savedInstanceState);
}
Upvotes: 1