title: SharedPreferences and Application class
body: <p>I have many shared preference for my app (mostly relating to color customization) and I'm unsure what the best method is to store/use them at runtime.</p>
  
  <p>Currently I am doing something like this (with more or less preferences depending on the view) in every activity/fragment:</p>
  
  <pre><code>SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getActivity());
  int buttonbg = settings.getInt("buttonmenu_bg", 0);
  int buttontxt = settings.getInt("buttonmenu_txt", 0);
  int headerclr = settings.getInt("header", 0);
  </code></pre>
  
  <p>And then using those to set the various colors in the display.  This seems like a lot of overhead to have to call the PreferenceManager each time and go through all that.</p>
  
  <p>So I started looking at creating an application class, reading the preferences in once and using static variables from the application class in the activities/fragment to set the display.</p>
  
  <p>My question is, are there any drawbacks or gotchas to doing this that I should consider before I venture further down the Application class path?</p>