title: Getting "cannot resolve method" error when trying to implement getSharedPreferences in Android Studio
body: <p>I'm trying to create a class KeyValueDB which stores methods for interacting with SharedPreferences, however I'm running into a problem just defining the class.  All I want the constructor to do is store a sharedPreferences object with the correct filename, but I'm getting a "cannot resolve method 'getSharedPreferences(java.lang.String,int)'</p>
  
  <p>I am passing a String and an int... I'm not sure what I'm doing wrong.  Appreciate any help!</p>
  
  <pre><code>package com.farmsoft.lunchguru.utils;
  
  import android.content.Context;
  import android.content.SharedPreferences;
  
  import java.util.ArrayList;
  import java.util.List;
  import java.util.Map;
  
  import org.json.JSONException;
  
  /**
   * Created by sxs on 4/28/2014.
   */
  public class KeyValueDB {
      private SharedPreferences sharedPreferences;
  
      public KeyValueDB(String prefName) {
          sharedPreferences = getSharedPreferences(prefName, Context.MODE_PRIVATE);
      }
  </code></pre>