title: Why i am not able to call adapter method from my activity
body: <p>I have defined a method <strong>removeItem</strong> in my Adapter class and i am trying to call that method from my activity but it doesn't recognize my method when i use the dot operator with my adapter class reference. Please help me out here.</p>
  
  <pre><code>public class RecyclerViewCalendarAdapter extends RecyclerView.Adapter&lt;RecyclerViewCalendarAdapter.ViewHolder&gt; {
  
  List&lt;EventDetails_Helper&gt; list;
  String startdate,enddate;
  List&lt;Date&gt; dates;
  MaterialCalendarView calendar_view;
  AppBarLayout appbar_calendar;
  
  
  RecyclerViewCalendarAdapter(List&lt;EventDetails_Helper&gt; list, MaterialCalendarView calendar_view, AppBarLayout appbar_calendar){
  
      this.list = list;
      this.calendar_view = calendar_view;
      this.appbar_calendar = appbar_calendar;
  
  }
  
  @Override
  public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
  
      View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.recyclerviewcalendar_item, parent, false);
  
      ViewHolder vh = new ViewHolder(v);
  
      return vh;
  }
  
  @Override
  public void onBindViewHolder(ViewHolder holder, int position) {
  
      holder.txtview_eventname.setText(list.get(position).name);
      holder.txtview_enddate.setText(list.get(position).target_date);
  
      holder.linearlayout_calendar.setTag(R.id.startdate,"2018-02-17");
      holder.linearlayout_calendar.setTag(R.id.enddate,list.get(position).target_date);
  
  
      holder.linearlayout_calendar.setOnClickListener(new CalendarLinearListener());
  }
  
  @Override
  public int getItemCount() {
      return list.size();
  }
  
  public void removeItem(int position) {
      list.remove(position);
      notifyItemRemoved(position);
  }
  
  public void restoreItem(EventDetails_Helper item, int position) {
      list.add(position, item);
      // notify item added by position
      notifyItemInserted(position);
  }
  
      public class ViewHolder extends RecyclerView.ViewHolder{
  
      TextView txtview_eventname,txtview_enddate,txtview_startdate;
      LinearLayout linearlayout_calendar;
      public RelativeLayout viewBackground, viewForeground;
  
  
  
      public ViewHolder(View itemView) {
          super(itemView);
  
          linearlayout_calendar = (LinearLayout) itemView.findViewById(R.id.linearlayout_calendar);
          txtview_eventname = (TextView) itemView.findViewById(R.id.txtview_eventname);
          txtview_startdate = (TextView) itemView.findViewById(R.id.txtview_startdate);
          txtview_enddate = (TextView) itemView.findViewById(R.id.txtview_enddate);
  
          viewBackground = itemView.findViewById(R.id.view_background);
          viewForeground = itemView.findViewById(R.id.view_foreground);
  
      }
  
  }
  
  private class CalendarLinearListener implements View.OnClickListener {
      @Override
      public void onClick(View v) {
  
          appbar_calendar.setExpanded(true);
          calendar_view.clearSelection();
  
          startdate = (String) v.getTag(R.id.startdate);
          enddate = (String) v.getTag(R.id.enddate);
  
          dates = getDates(startdate,enddate);
          datemarkstyle(dates);
  
      }
  }
  
  private static List&lt;Date&gt; getDates(String dateString1, String dateString2)
  {
      ArrayList&lt;Date&gt; dates = new ArrayList&lt;Date&gt;();
      DateFormat df1 = new SimpleDateFormat("yyyy-MM-dd");
  
      Date date1 = null;
      Date date2 = null;
  
      try {
          date1 = df1 .parse(dateString1);
          date2 = df1 .parse(dateString2);
      }
      catch (Exception e) {
          e.printStackTrace();
      }
  
      Calendar cal1 = Calendar.getInstance();
      cal1.setTime(date1);
  
  
      Calendar cal2 = Calendar.getInstance();
      cal2.setTime(date2);
  
      while(!cal1.after(cal2))
      {
          dates.add(cal1.getTime());
          cal1.add(Calendar.DATE, 1);
      }
      return dates;
  }
  
  private void datemarkstyle(List&lt;Date&gt; dates) {
  
      try{
  
          calendar_view.setCurrentDate(dates.get(0));
          int i;
          int year,month,day;
  
          for(i=0;i&lt;dates.size();i++){
  
              calendar_view.setDateSelected(dates.get(i),true);
          }
  
      }catch(Exception e){
  
          e.printStackTrace();
      }
  
  }}
  </code></pre>
  
  <p>In my Activity i am doing the following :-</p>
  
  <pre><code>        @Override
      public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction, int position) {
  
          if(viewHolder instanceof RecyclerViewCalendarAdapter.ViewHolder){
  
              String name = list.get(viewHolder.getAdapterPosition()).name;
  
              EventDetails_Helper deleteditem = list.get(viewHolder.getAdapterPosition());
              int deleteIndex = viewHolder.getAdapterPosition();
  
              mAdapter.removeItem
          }
      }
  </code></pre>
  
  <p>But the thing is it is not allowing me to access the method <strong>removeItem();</strong></p>