0
I’ve searched several gringo sites but found nothing, including here.
I have a problem in the application that whenever the user minimizes it and uses the mobile phone for something else on cell phones with little memory it gets erased for new data, so when the application is opened again (it was in the background) it always error and closes why an object is not saved, was in memory and after erasing it gets null by making the error happen.
Is my question advisable to do this with Sharedpreferences? Because I always see it being used with strings, int, bollean etc. or there is another more efficient method?
For this purpose it is normal to use the Bundle passed to the method
onSaveInstanceState()
.– ramaral
This can be of great help, I will search here how to use, Rigadão!
– E. Greeff
A doubt: To save it enters the [ onSaveInstanceState(Bundle outstate)] and to reload?
– E. Greeff
In the
onCreate()
, as explained there.– ramaral
Yes, but in the app Mainactivity does not pass again onCreate, so I put onRestart
– E. Greeff
If the Activity is not recreated (onCreate() called) then the problem is another. I suggest you ask another question, code and error log, and explain exactly what’s happening.
– ramaral