title: android - How to Intent RecyclerView in AdapterClass
body: <p>I need my <code>RecyclerView</code> Image can be pressed and go to next activity. I have the <code>Adapter</code> code.</p>
  
  <pre><code>public class MakananAdapter extends RecyclerView.Adapter&lt;MakananAdapter.ViewHolder&gt; {
  ArrayList&lt;Makanan&gt; makananList;
  
  public MakananAdapter(ArrayList&lt;Makanan&gt; makananList)
  {
      this.makananList = makananList;
  }
  
  @Override
  public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_list,parent,false);
      ViewHolder vh = new ViewHolder(v);
      return vh;
  }
  
  @Override
  public void onBindViewHolder(ViewHolder holder, int position) {
      Makanan tanaman = makananList.get(position);
      holder.tvJudul.setText(tanaman.judul);
      /*holder.tvHarga.setText(tanaman.harga);*/
      holder.ivFoto.setImageDrawable(tanaman.foto);
      holder.tvJudul.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
  
          }
      });
  }
  
  
  
  @Override
  public int getItemCount() {
      if(makananList!=null)
          return makananList.size();
      return 0;
  }
  
  public class ViewHolder extends RecyclerView.ViewHolder {
      ImageView ivFoto;
      TextView tvJudul;
      TextView tvHarga;
  
      public ViewHolder(View itemView) {
          super(itemView);
          ivFoto = (ImageView) itemView.findViewById(R.id.imageView);
          tvJudul = (TextView) itemView.findViewById(R.id.textViewJudul);
          /*tvHarga = (TextView) itemView.findViewById(R.id.textViewHarga);*/
      }
  }}
  </code></pre>
  
  <p>How to Intent RecyclerView in AdapterClass?</p>