Just looking for ideas. Have lot of data that need...
# android
c
Just looking for ideas. Have lot of data that needs to be inputted by the user for addition of something, so what is the best approach around it? One is to divide it into steps or parts, but how does one maintain the state of data on previous screens then before moving to next one, so that if a user traverses back, their data remains safe.
r
As long as they don't kill the app EditText does this by default.
c
I get that, but let's say @Ray we have a series of fragments, each corresponding to a step and the data gets saved at the end. But in case a person needs to revert back to a previous screen, the data on current screen will be lost, since they'll go back.
r
Yes I was just about to mention that. Then for this you can use shared pref/data store or DB(Room)
So at each point the user clicks a button to navigate to the next screen you save the user inputs
If the user navigates back you fetch the data in onCreateView()
c
This is a good idea. Are they an alternates beside it? Creating the local DB would be out of scope, although it is the only one that makes most sense.