Home > database >  Boolean value must be kept even after the app is closed
Boolean value must be kept even after the app is closed

Time:05-30

I want to know how to keep integer values and boolean values even if the application is closed...

I've tried making it static and pressed back until the application exits (which uses onStop method) but when I closed the application (which uses onDestroy) the variables value goes back to its default value...

I will appreciate to know simple solutions for this one and lastly I want to know if there is a way to edit asset files...

CodePudding user response:

I think you need to use shared prefrences or data store .. for that

CodePudding user response:

read THIS doc, pick your favourite way for storing presistent data, I would use use SharedPreferences (walkthrough HERE)

please read some docs and tutorials before asking such basic question... literally thousands answers for such question in Internet, just search

  • Related