I am developing a project in that i am creating one static class's object . So when i switch off device at that time all the static objects are cleared so i want to stored into shared preference . So i can use it again . Is it possible to save it in shared preference?
Or any other possibility to use that object after restart device ?
I am developing a project in that i am creating one static class’s object
Share
You can only save primitive data types like float, int, string, set of strings or booleans. You can serialize your objects in byte stream and then reacreate them from the byte stream, you can have a look at this Answer also this Answer