title: How to acces SharedPrefences from recyclerView adapter?
body: <p>I want to acces SharedPrefences from my adapter because I want to check a variable to set an ImageView visible or gone.</p>
  
  <pre><code>class MainAdapter extends RecyclerView.Adapter&lt;MainAdapter.ViewHolder&gt; implements View.OnClickListener, View.OnLongClickListener{
  
  
  ArrayList&lt;String&gt; mData;
  public ImageView mMinus;
  public static final String SHARED_PREFS_DATA = "sharedPrefsData";
  
  
  
  public MainAdapter(ArrayList&lt;String&gt; data) {
          mData = data;
  }
  
  
  
  @NonNull
  @Override
  public MainAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
      View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row, parent, false);
      return new ViewHolder(view);
  }
  
  @Override
  public void onBindViewHolder(@NonNull MainAdapter.ViewHolder holder, int position) {
      holder.mText.setText(mData.get(position));
  
      SharedPreferences sharedPreferences = getSharedPreferences(SHARED_PREFS_DATA, 0);
      int a = sharedPreferences.getInt("visible", 0);
      if(a == 0)
         holder.mMinus.setVisibility(View.GONE);
      else
         holder.mMinus.setVisibility(View.VISIBLE); 
  
  }
  </code></pre>
  
  <p>error: cannot find symbol method getSharedPreferences(String,int)</p>