Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 126.96.36.199 release ready!
Its a common problem that everyone gets in the app development i.e data in shared preference is lost if you will force stop your app.
The problem can be solved very easily. The method is edit() on shared preference object reterns an Editor object through which you can make changes to your shared preference for which it is created by edit(). Everytime you want to change the values in Shared preference create a new Editor object because might be the editor object you are using is collected by the garbage collector.
So create a new object each time you edit your shared preference as:
And be sure to commit your changes as soon as all the changes are done.
Your email address will not be published. Required fields are marked*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
Webkul is a truly trusted and supported IT Company to develop business ideas for e-commerce. They provide professional support after deploying the solution to production and be responsible to act for fixing the reported issues or system errors. We highly encourage to deal with Webkul for business development.
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.