title: sharedPreferences in Fragment
body: <p>I know this has been asked before, but i can't seem to figure it out</p>
  
  <p>i am trying to get my preferences by this:</p>
  
  <pre><code>SharedPreferences preferences = this.getActivity().getSharedPreferences("storedName",     Context.MODE_PRIVATE);
      String loginemail = preferences.getString("storedName", "");
  </code></pre>
  
  <p>but this doesn't seem to work, i have multiple sharedPreferences which i need to get in my fragment what is the correct way to do it?
  As <code>getDefaulSharedPreferences(this)</code> doesn't work.</p>
  
  <p>i store my prefs like so:</p>
  
  <pre><code>savePreferences("shareUniqePass", uniqePassIds.getText().toString());
  savePreferences("storedName", inputEmail.getText().toString());
  savePreferences("Storedpass", inputPassword.getText().toString());
  
  private void savePreferences(String key, boolean value){
      SharedPreferences sharedPreferences = PreferenceManager
              .getDefaultSharedPreferences(this);
      Editor checkbox = sharedPreferences.edit();
      checkbox.putBoolean(key, value);
      checkbox.commit();
  }
  private void savePreferences(String key, String value){
      SharedPreferences sharedPreferences = PreferenceManager
              .getDefaultSharedPreferences(this);
      Editor names = sharedPreferences.edit();
      names.putString(key, value);
      names.commit();
  }
  </code></pre>