0
Hello to all
I’m creating an app that when the person logs in, the app brings the data Nome
, Login
, Senha
and Foto(a url)
of the server database, and saves that data in a Singleton
so that they are used in all other activitys
. So far so good, everything working fine, but when I made a button for the person to choose a photo from the gallery and upload it (all this is working), I realized that if I take a while to choose the photo and stay waiting in the gallery, the data I recorded on Singleton
'get lost' (as if they were erased or whatever).
I was wondering if there is a way to record this data without them 'getting lost' when I leave my application in background
.
Note: I did not post any code because I believe it is not necessary, since there is no error in it, but the data that 'disappear', I believe that android is somehow erasing them to free memory or something. But if you need, just ask me to edit the question and put the code.
Why you don’t use Sharedpreferences to store this information?
– Geferson