// Inside myViewHolder LinearLayout linearLayout = itemView.findViewById(R.id.notebody); // Inside onBindViewHolder TextView txt = new TextView(holder.linearLayout.getContext()); holder.linearLayout.addView(imageView);