title: Is there a way to make SharedPreferences global throughout my whole Android app?
body: <p>Is there a way to make SharedPreferences global throughout my whole app? Right now I'm using these lines in a lot of places throughout my code to store simple on/off settings for a number of preferences that my users can set. I just want to call them once globally if possible:</p>
  
  <pre><code>SharedPreferences settings = getSharedPreferences("prefs", 0);
  SharedPreferences.Editor editor = settings.edit();
  </code></pre>
  
  <p>Any tips on how to be able to call just these line in all classes would be awesome:</p>
  
  <pre><code>editor.putString("examplesetting", "off");
  editor.commit(); 
  </code></pre>
  
  <p>and</p>
  
  <pre><code>String checkedSetting = settings.getString("examplesetting", "");
  </code></pre>