title: Recycler View item add
body: <p>i have a recyclerview to display data from api feed, however it is adding blank rows of data. How do i only add the data needed and if does not match criteria do not add blank row?</p>
  
  <p>here is my data adapter:</p>
  
  <pre><code>public class DataAdapter extends 
   RecyclerView.Adapter&lt;DataAdapter.ViewHolder&gt;{
  
      private ArrayList&lt;Included&gt; includedData;
      private Included matchDataIncluded;
      private Data matchData;
  
  
      public DataAdapter(ArrayList&lt;Included&gt; includedData) {
          this.includedData = includedData;
          this.matchDataIncluded = matchDataIncluded;
      }
  
  
      @Override
      public DataAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int i) {
  
          View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item, parent, false);
          return new ViewHolder(view);
      }
  
      @Override
      public void onBindViewHolder(ViewHolder holder, int position) {
  
          if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.KITKAT) {
              if (Objects.equals(includedData.get(position).getType(), "competitions") &amp;&amp; includedData.get(position).getId() != null) {
                  holder.tvCompetitionName.setText(includedData.get(position).getAttributes().);
              }
          }
  
  
      }
  
      @Override
      public int getItemCount() {
          return includedData.size();
      }
  
      @Override
      public long getItemId(int position) {
          return position;
      }
  
      @Override
      public int getItemViewType(int position) {
          return position;
      }
  
      public class ViewHolder extends RecyclerView.ViewHolder {
  
          private TextView tvCompetitionName;
  
          public ViewHolder(View itemView) {
              super(itemView);
  
              tvCompetitionName = (TextView) itemView.findViewById(R.id.competitionNameTV);
          }
      }
  }
  </code></pre>