title: Adapter is not refreshing when using spinner items
body: <p>I am using spinner to select and refresh the items. </p>
  
  <p>For eg: If I select All, it should display all items. If I choose "Sell In", it should display only sell in items. So based on the spinner selection, items should filter out and need to display.</p>
  
  <p>I tried to filter out, but it's not filtering out. Adapter is not refreshing the items.</p>
  
  <p>Here is code.</p>
  
  <p><strong>MainActivity:</strong></p>
  
  <pre><code>public class Activities extends BaseActivity {
      private RecyclerView recyclerView;
      private Spinner spinner;
      String[] countriesList = {"All", "Sell In", "Registrasi", "Re-Registrasi"};
      ActivitiesListAdapter adapter;
  
      @Override
      protected void onCreate(@Nullable Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          contentView = inflater.inflate(R.layout.activity_activities_list, null);
          insertPoint.addView(contentView);
          recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
           spinner  = (Spinner) findViewById(R.id.spinner);
          adapter = new ActivitiesListAdapter(getData(), this);
          LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, OrientationHelper.VERTICAL, false);
          recyclerView.setLayoutManager(linearLayoutManager);
          recyclerView.setNestedScrollingEnabled(false);
          recyclerView.setAdapter(adapter);
          CustomSpinnerAdapter customAdapter=new CustomSpinnerAdapter(this,countriesList);
          spinner.setAdapter(customAdapter);
          spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
              @Override
              public void onItemSelected(AdapterView&lt;?&gt; adapterView, View view, int i, long l) {
                  String items = adapterView.getItemAtPosition(i).toString();
                  // adapter.getFilter().filter(items);
                  final List&lt;RetailerActivities&gt; filteredModelList2 = adapter.filter2(getData(), items);
                  //adapter.setFilter(filteredModelList2);
  
              }
  
              @Override
              public void onNothingSelected(AdapterView&lt;?&gt; adapterView) {
  
              }
          });
  
  
      }
  //the first item to be compared in Spinner. 
      public static List&lt;RetailerActivities&gt; getData() {
          List&lt;RetailerActivities&gt; list = new ArrayList&lt;&gt;();
          list.add(new RetailerActivities("Sell In", "Selli Cell", "13/06/2017 09:10", R.drawable.ic_tag));
          list.add(new RetailerActivities("Registrasi", "Farras Cell", "13/06/2017 09:10", R.drawable.ic_registrasi));
          list.add(new RetailerActivities("Re-Registrasi", "Farras Cell", "13/06/2017 09:10", R.drawable.ic_registrasi));
          list.add(new RetailerActivities("POSM &amp; Visibility", "Farras Cell", "13/06/2017 09:10", R.drawable.ic_poms));
          list.add(new RetailerActivities("Sell In", "Selli Cell", "13/06/2017 09:10", R.drawable.ic_tag));
          return list;
      }
  </code></pre>
  
  <p><strong><em>Adapter class</em></strong></p>
  
  <pre><code>public class ActivitiesListAdapter extends RecyclerView.Adapter&lt;RecyclerView.ViewHolder&gt;   {
      private List&lt;RetailerActivities&gt; mList;
      private Context context;
      private List&lt;RetailerActivities&gt; mFilteredList;
  
      public ActivitiesListAdapter(List&lt;RetailerActivities&gt; list, Context context) {
          this.mFilteredList = this.mList = list;
          this.context = context;
      }
  
      @Override
      public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          View view;
          view = LayoutInflater.from(parent.getContext()).inflate(R.layout.activities_row, parent, false);
          return new RetailerActivitiesView(view);
      }
  
      @Override
      public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
          RetailerActivities object = mList.get(position);
          //RetailerActivities retailerFilter = mFilteredList.get(position);
          ((RetailerActivitiesView) holder).title.setText(object.getTitle());
          ((RetailerActivitiesView) holder).name.setText(object.getName());
          ((RetailerActivitiesView) holder).dateTime.setText(object.getDateTime());
          ((RetailerActivitiesView) holder).profileIcon.setImageResource(object.getDrawablesIcon());
  
      }
  
      @Override
      public int getItemCount() {
          if (mList == null)
              return 0;
          return mList.size();
      }
  
      @Override
      public int getItemViewType(int position) {
          if (mList != null) {
              RetailerActivities object = mList.get(position);
              if (object != null) {
                  //return object.getType();
              }
          }
          return 0;
      }
  
  
  
      public static class RetailerActivitiesView extends RecyclerView.ViewHolder {
          private ImageView profileIcon;
          private TextView title;
          private TextView name;
          private TextView dateTime;
  
          public RetailerActivitiesView(View itemView) {
              super(itemView);
              title = (TextView) itemView.findViewById(R.id.recycle_txt_acc_num);
              name = (TextView) itemView.findViewById(R.id.recycle_txt_acc_name);
              dateTime = (TextView) itemView.findViewById(R.id.timestamp);
              profileIcon = (ImageView) itemView.findViewById(R.id.recycle_profile);
          }
      }
      public List&lt;RetailerActivities&gt; filter2(List&lt;RetailerActivities&gt; models, String filterType) {
  
          final ArrayList&lt;RetailerActivities&gt; filteredModelList = new ArrayList&lt;&gt;();
          for (RetailerActivities model:models) {
              final String cardTypeTest = model.getTitle(); //title is //where i need to compare from the spinner string..
  
              if (cardTypeTest.equalsIgnoreCase(filterType)) {
                  filteredModelList.add(model);
              }
          }
          return filteredModelList;
      }
  }
  </code></pre>