title: get SharedPreferences from a service
body: <p>I am trying to access shared preferences from a service. I have used the the following to save the value of text to a string...</p>
  
  <pre><code>SharedPreferences sharedPreferences = getPreferences(MODE_PRIVATE);
  SharedPreferences.Editor editor = sharedPreferences.edit();
  editor.putString("Ignore1_value", Example.getText().toString());
  editor.commit();
  </code></pre>
  
  <p>But, how would i get the value in a service? Everything i have tried returns as nothing. Any help would be perfect and much appreciated?</p>
  
  <p>I looked through some other questions as well with no solution. I have came up with this, but like i said it returns it as no text.</p>
  
  <pre><code>Context ctx = getApplicationContext();
      SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(ctx);
      String example1string = sharedPreferences.getString("Ignore1_value","");
      Log.i("**GetSettings", example1string);
  </code></pre>