java - singleton class that survives Process termination -


i've read several post regarding singleton class destruction or singleton pattern bad in android this , this

but not able understand how declare singleton class or use sharedpreference persistance can provide example on how maintain global objects across application or how achieve in proper way appreciated.

i think this link mentioned quite good.as personal experience best way maintain global objects in application use class extends application class, can manage objects setter , getter methods in class.this technically works singleton in android except of house keeping done android it's wise use mechanism instead of singleton. on other hand shared preferences has entirely different job , used storing user data , behavior


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -