title: How to place ads randomly in between of RecyclerView?
body: <p>I'm using <a href="https://github.com/mikepenz/FastAdapter" rel="nofollow">FastAdapter</a> in my app and I want to place ads randomly in between of <code>RecyclerView</code>. For ex - like an ad after 3 <code>RecyclerView</code> items then after 4, then after 2 and so on and so forth. </p>
  
  <p>This is how I'm using FastAdapter:</p>
  
  <pre><code>FastItemAdapter&lt;HRequest&gt; fastItemAdapter = new FastItemAdapter&lt;&gt;();
  fastItemAdapter.withSelectable(true);
  
  RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
  recyclerView.setHasFixedSize(true);
  recyclerView.setLayoutManager(linearLayoutManager);
  recyclerView.setItemAnimator(new DefaultItemAnimator());
  
  HRequest hRequest = new HRequest(imageUID);
  fastItemAdapter.add(helpRequest);
  recyclerView.setAdapter(fastItemAdapter);
  </code></pre>
  
  <p>Here's <code>HRequest.java</code> file's code:</p>
  
  <pre><code>public class HRequest extends AbstractItem&lt;HRequest, HRequest.ViewHolder&gt; {
  
          public String imageURL;
  
          public HRequest() {
  
          }
  
          public HRequest(String imageURL) {
              this.imageURL = imageURL;
          }
  
          // Fast Adapter methods
          @Override
          public int getType() {
              return R.id.recycler_view;
          }
          @Override
          public int getLayoutRes() {
              return R.layout.h_request_list_row;
          }
          @Override
          public void bindView(ViewHolder holder) {
              super.bindView(holder);
  
              holder.imageURL.setText(imageURL);
  
          }
          // Manually create the ViewHolder class
          protected static class ViewHolder extends RecyclerView.ViewHolder {
  
              TextView imageURL;
  
              public ViewHolder(View itemView) {
                  super(itemView);
                  imageURL = (TextView)itemView.findViewById(R.id.imageURL);
  
  if (!imageURL.getText().toString().isEmpty()) {
  
  if (imageURL.getText().toString().startsWith("https://firebasestorage.googleapis.com/") || imageURL.getText().toString().startsWith("content://")) {
                      Picasso.with(itemView.getContext())
                              .load(imageURL.getText().toString())
                              .into(homelessImage);
                  } else {
                      Toast.makeText(itemView.getContext(), "some problem", Toast.LENGTH_SHORT).show();
                  }
  
              } else {
                  Toast.makeText(itemView.getContext(), "no imageUID found", Toast.LENGTH_SHORT).show();
              }
  
              }
          }
  
      }
  </code></pre>
  
  <p>How can I achieve what I want?</p>