I have 7 activites all with back and forth navigation buttons between the rest; activites consist of editTexts, Spinners, textViews, TimePickers, DatePickers, and checkboxes.
I want all UI to be present and saved through navigation of an application instance; however on application termination everything needs to default.
My 8th activity collects all UI and places into an email . . .fyi
I have read alot about both onSavedInstanceState & SharedPreferences way of saving the data as activities go back and forth . . .
Which would be better for me?
It will depend on how you want to manage the data. Both options (and more) are feasible:
SharedPreferences
. onSavedInstanceState
. SQLiteDatabase
SharedPreferences
onSavedInstanceState
onSaveInstanceState
will be forgotten after reboot, and when starting a new instance of an activity they will not be passed, so they are only for remembering the state of the activityonRetainNonConfigurationInstance
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With