title: Kotlin : How to click on item in a Recyclerview Inside another Recyclerview
body: <p>After seen all the similiar questions, I don't find a solution of my problem, which the description as follows:
  In my android app, I use Kotlin as language. In my app, I have a lot of category and each category have a list of products. In my home activity, I create a vertical RecyclerView named "productListOfCategory". In the "productListOfCategory" adapter,a textView to display a category name and a recyclerView to display all related product list. The following code is the description of "ProductListOfProductTypeAdapter" adapter : (ProductType = category)</p>
  
  <pre><code> class ProductListOfProductTypeAdapter(private val context: Context, private val ProductTypeIDWithProduct: Map&lt;String, Array&lt;ProductData&gt;&gt;, private val productTypeDetail: Array&lt;ProductTypeData&gt;)
      : RecyclerView.Adapter&lt;ProductListOfProductTypeAdapter.ViewHolder&gt;(),ProductOfProductTypeAdapter.OnItemClickListener{
      override fun onItemClick(view: View, viewModel: ProductData) {
          val intent = Intent(context,ProductDetail::class.java)
          context.startActivity(intent)
      }
      override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
          val view = LayoutInflater.from(parent.context).inflate(R.layout.item_list_product_product_type, parent, false)
          return ViewHolder(view)
      }
  
      override fun getItemCount() = ProductTypeIDWithProduct.size
  
      override fun onBindViewHolder(holder: ViewHolder, position: Int) {
          val itemType = ProductTypeIDWithProduct.keys.elementAt(position)
          holder.productTypeName.text = getName(itemType)
  
          val arrayProductOfProductType = ProductTypeIDWithProduct[itemType] as ArrayList&lt;ProductData&gt;
  
          holder.productListOfProductType.apply {
              holder.productListOfProductType.layoutManager = LinearLayoutManager(context, RecyclerView.HORIZONTAL, false)
              holder.productListOfProductType.adapter = ProductOfProductTypeAdapter(arrayProductOfProductType,context,this@ProductListOfProductTypeAdapter)
          }
  
      }
  
      inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
          val productTypeName: TextView = itemView.textViewProductTypeName
          val productListOfProductType: RecyclerView = itemView.recyclerViewProductOfProductType
      }
  </code></pre>
  
  <p>"ProductOfProductTypeAdapter" is the second adapter which the code as the following :</p>
  
  <pre><code>class ProductOfProductTypeAdapter(private val products: ArrayList&lt;ProductData&gt;, private val context: Context,private val mListener: OnItemClickListener)
      : RecyclerView.Adapter&lt;ProductOfProductTypeAdapter.ViewHolder&gt;() {
  
      override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
          val view = LayoutInflater.from(parent.context).inflate(R.layout.item_product_featured, parent, false)
          return ViewHolder(view)
  
      }
  
      override fun getItemCount() = products.size
  
      override fun onBindViewHolder(holder: ViewHolder, position: Int) {
          val productItem = products[position] as Map&lt;String, Map&lt;String, String&gt;&gt;
  
          holder.productName.text = productItem["name"]?.get("En").toString()
          holder.productWeight.text = productItem["weight"].toString().plus(context.resources.getString(R.string.ml))
          holder.productPrice.text = "$".plus(productItem["price"].toString()).plus("/")
          holder.productRating.text = productItem["reviewsValue"].toString()
          holder.itemView.setOnClickListener {
              mListener.onItemClick(holder.itemView, products[position])
              notifyDataSetChanged()
          }
      }
  
      inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
          val productName: TextView = itemView.itemProdFeaturedName
          val productPrice: TextView = itemView.itemProdFeaturedPrice
          val productImage: ImageView = itemView.itemProdFeaturedImage
          val productWeight: TextView = itemView.txtViewWeight
          val productRating: TextView = itemView.itemProdFeaturedRate
      }
  
     interface OnItemClickListener {
          fun onItemClick(view: View,viewModel: Map&lt;String, Map&lt;String, String&gt;&gt;)
      }
  </code></pre>
  
  <p>My problem is How to click on product and dispaly the product detail activity.I try as the following but still not get what I want.</p>