Re: [android-developers] Global variable extend application class
On Sun, Apr 8, 2012 at 11:45 PM, Etienne <lawloretienne@gmail.com> wrote:
>> I am using the application object to maintain global application state.
>> What are the disadvantages of sub-classing the Application class? And what
>> advantages do SharedPreferences have over my solution?
>
I don't think SharedPreferences are the solution. Especially not for
hash tables. But you might want to consider using a database or
something in the case that your app gets killed by the system, which
would be the reason you don't want to subclass Application. Sure, if
you use it correctly, there are some use cases, but most of the time
you can factor global state out into a content provider or passing
intents between your components.
kris
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home