Android global preferences -


i working android app , looking way establish global preferences later accessible all activities/classes in app. similar know people end using appdelegate in objective c programming. answers have seen on net suggest either extend application or save data sharedpreferences. know if there way combine 2 approches in app, can keep calling properties of preferences object (such preferences.getname()) , persist data sharedpreferences that, in case android decides restart application , loose data in preferences object, can still sharedpreferences , repopulate preferences object. can please let me know how can done , if viable?

see answer @ https://stackoverflow.com/a/13673178/338479

in short, create "singleton" class hold preferences, , data persists long application stays in memory. if application killed system, singleton class silently reloads later.

it's possible extending application class, conventional wisdom holds there's no real advantage doing way.


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -