title: One RecyclerAdapter for two activity
body: <p>I make app with a couple of different categories of pictures. I want to display those pictures with RecyclerView.</p>
  
  <p>I want to display button as a image when I clicked button before. 
  Can I make it in one adapter? Now I have two adapters, that code is as follow:</p>
  
  <pre><code>public class RecyclerAdapter extends RecyclerView.Adapter&lt;RecyclerAdapter.ViewHolder&gt; {
  private int[] images = {
     R.drawable.imageA1, ....    R.drawable.imageA10
  };
  private int[] images2 = {
          R.drawable.imageB1, ....    R.drawable.imageB10
    };
  
  class ViewHolder extends RecyclerView.ViewHolder{
  
      public int currentItem;
      public ImageView itemImage, itemImage2;
      public TextView itemTitle;
  
      public ViewHolder(View itemView) {
          super(itemView);
          itemImage = (ImageView)itemView.findViewById(R.id.imageView);
  }
  @Override
  public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
      View v = LayoutInflater.from(viewGroup.getContext())
              .inflate(R.layout.article_layout, viewGroup, false);
      ViewHolder viewHolder = new ViewHolder(v);
      return viewHolder;
  }
  @Override
  public void onBindViewHolder(ViewHolder viewHolder, int i) {
      viewHolder.itemImage.setImageResource(images[i]);
       }
  @Override
  public int getItemCount() {
      return images.length;
  }
  </code></pre>
  
  <p>}</p>