title: Loading up value from SharedPreferences
body: <p>In my Application class, I have the following:</p>
  
  <pre><code>public void loadPrefs(){
  SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);  
  Boolean soundValue = sharedPrefs.getBoolean("SOUND", false);    
  }
  
  public void savePrefs(String key, boolean value){
  
  SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
  Editor edit = sharedPrefs.edit();       
      edit.putBoolean(key, value);            
  edit.commit();                          
  
  }
  </code></pre>
  
  <p>All OK there as far as I can tell.</p>
  
  <p>Now in my main class which extends SurfaceView, I have the following:</p>
  
  <pre><code>myApp mySettings = (myApp)getContext().getApplicationContext();
  </code></pre>
  
  <p>Then I can save values like so: (Again from my surfaceView activity)</p>
  
  <pre><code>myPlanSettings.savePrefs("SOUND", false);}
  </code></pre>
  
  <p>However, what I just cannot work out is how to read the value back so I can set a local variable like so:</p>
  
  <pre><code>Boolean thisValue = (the value from the shared preferences).
  </code></pre>
  
  <p>Thanks for any help</p>