title: Cannot call method of RecyclerView adapter from an activity
body: <p>I am trying to set the data for recycler view to display from an AsyncTask. I am calling the method setdataEntries from the postExecute of inner class AsyncTask. But the android studio is showing me error could not find the method.</p>
  
  <p>Adapter class</p>
  
  <pre><code>public class EntryAdapter extends RecyclerView.Adapter&lt;EntryAdapter.ViewHolder&gt; {
  List&lt;UserTuple&gt; entries;
  final private itemClickListener mOnClickListener;
  public interface itemClickListener{
      void onItemClick(UserTuple utuple);
  }
  
  public EntryAdapter(itemClickListener clickhandler) {
      mOnClickListener = clickhandler;
  }
  public void setdataEntries(List&lt;UserTuple&gt; Data) {
      entries = Data;
      notifyDataSetChanged();
  }
  @Override
  public EntryAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.singleusertuple,parent,false);
      return new ViewHolder(view);
  }
  
  @Override
  public void onBindViewHolder(EntryAdapter.ViewHolder holder, int position) {
  
      holder.Username.setText(entries.get(position).getUsername());
      holder.Password.setText(entries.get(position).getPassword());
  
  }
  
  @Override
  public int getItemCount() {
      return entries.size();
  }
  
  public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
  
      private TextView Username;
      private TextView Password;
      private CardView card;
      public ViewHolder(View itemView) {
          super(itemView);
          Username = itemView.findViewById(R.id.susername);
          Password=itemView.findViewById(R.id.pass);
          itemView.setOnClickListener(this);
      }
  
      @Override
      public void onClick(View v) {
          int adapterPosition = getAdapterPosition();
          UserTuple ut=new UserTuple(entries.get(adapterPosition).getUsername(),entries.get(adapterPosition).getPassword());
          mOnClickListener.onItemClick(ut);
      }
  }
  }
  </code></pre>
  
  <p>Calling Activity</p>
  
  <pre><code>public class Usertuple extends AppCompatActivity implements EntryAdapter.itemClickListener {
  private RecyclerView recyclerView ;
  private RecyclerView.Adapter adapater;
  private SnapHelper snapHelper;
  private List&lt;UserTuple&gt; entries;
  private ProgressBar mLoadingIndicator;
  private Bundle extras;
  
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_logins);
      extras = getIntent().getExtras();
      //String site= extras.getString("sitename");
      mLoadingIndicator = (ProgressBar) findViewById(R.id.pb_loading_indicator);
  
      Log.i("Logins","Size of returned list "+entries.size());
      recyclerView = findViewById(R.id.recycleview);
      recyclerView.setLayoutManager(new LinearLayoutManager(this));
      recyclerView.setHasFixedSize(true);
      adapater = new EntryAdapter(this);
      recyclerView.setAdapter(adapater);
      snapHelper= new LinearSnapHelper();
      snapHelper.attachToRecyclerView(recyclerView);
      dataView();
  
  }
  public void dataView() {
      String site= extras.getString("sitename");
      recyclerView.setVisibility(View.VISIBLE);
      new FetchDataTask().execute(site);
  }
  
  @Override
  public void onItemClick(UserTuple utuple) {
  
  }
  private String key(){
      SharedPreferences sharedPref = getSharedPreferences(
              "User", this.MODE_PRIVATE);
      final String passphrase = sharedPref.getString("userid", "none");
      return passphrase;
  }
  public void showerror(){
      recyclerView.setVisibility(View.GONE);
      Toast.makeText(this,"Error in retrieving",Toast.LENGTH_SHORT).show();
  
  }
  public setdata(List&lt;UserTuple&gt; data){
      adapater.setdataEntries(data);
  }
  public class FetchDataTask extends AsyncTask&lt;String, Void, List&lt;UserTuple&gt;&gt; {
  
      @Override
      protected void onPreExecute() {
          super.onPreExecute();
          mLoadingIndicator.setVisibility(View.VISIBLE);
      }
  
      @Override
      protected List&lt;UserTuple&gt; doInBackground(String... params) {
  
          /* If there's no zip code, there's nothing to look up. */
          if (params.length == 0) {
              return null;
          }
  
          String site = params[0];
  
          try {
              AppDatabase db = Room.databaseBuilder(getApplicationContext(),AppDatabase.class, "production")
                      .build();
              entries =db.entryDao().getSpecific(site);
              for(UserTuple ut : entries){
                  Log.i("password",ut.getPassword());
                  String st = new Decryption().decrypt(ut.getPassword(),key());
                  Log.i("After decryption",st);
                  ut.setPassword(st);
              }
              return entries;
  
          } catch (Exception e) {
              e.printStackTrace();
              return null;
          }
      }
  
      @Override
      protected void onPostExecute(List&lt;UserTuple&gt; Data) {
          mLoadingIndicator.setVisibility(View.INVISIBLE);
          if (Data != null) {
              adapater.setdataEntries(Data);
          } else {
              showerror();
          }
      }
  }
  
  
  }
  </code></pre>
  
  <p>I want the database calls to be a background task. I don't want the activity to freeze waiting for database calls. Any ideas? Thanks </p>