Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public int getItemCount() {return description_list.size();}
- class ItemViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{
- ImageView iv_product;
- TextView tv_description;
- Button btn_detail;
- public ItemViewHolder(View itemView){
- super(itemView);
- iv_product = itemView.findViewById( R.id.product_iv );
- tv_description = itemView.findViewById( R.id.description );
- btn_detail = itemView.findViewById( R.id.detail_btn );
- btn_detail.setOnClickListener( this );
- }
- // Button Function
- @Override
- public void onClick(View v){
- if (v == btn_detail){
- Intent i = new Intent( ctx, DetailActivity.class );
- i.putExtra( "image", image_list.get( getAdapterPosition() ) );
- i.putExtra( "text", description_list.get( getAdapterPosition() ) );
- ctx.startActivity( i );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement