title: Share Intent text using Kotlin on Android
body: <p>I want to share text in my <strong>CardView</strong> using share Intent using kotlin but there is a problem with last line in the code in kotlin 
  the code </p>
  
  <pre><code> val shareIntent = Intent()
              shareIntent.action = Intent.ACTION_SEND
              shareIntent.putExtra(Intent.EXTRA_STREAM, "ali")
              shareIntent.type = "text/plain"
              startActivity(Intent.createChooser(shareIntent, getResources().getText(R.string.send_to)))
  </code></pre>
  
  <p>here  is the problem in the code </p>
  
  <pre><code>startActivity(Intent.createChooser(shareIntent, getResources().getText(R.string.send_to)))
  </code></pre>
  
  <p>please help me</p>
  
  <p>see the images to understand me </p>
  
  <p>images</p>
  
  <p><a href="https://ibb.co/jQwYXw" rel="noreferrer">https://ibb.co/jQwYXw</a></p>
  
  <p><a href="https://ibb.co/id0tXw" rel="noreferrer">https://ibb.co/id0tXw</a></p>
  
  <p><a href="https://ibb.co/fbCU5G" rel="noreferrer">https://ibb.co/fbCU5G</a></p>
  
  <p>the adapter full code </p>
  
  <pre><code>class MyAdapter(context: Context, listItem: ArrayList&lt;com.EliteTeam.comedytaste.Model.Movie&gt;) : RecyclerView.Adapter&lt;MyAdapter.MyViewHolder&gt;() {
  
  var Context = context
  var movieList = listItem;
  var layoutInflator = LayoutInflater.from(context)
  
  override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): MyViewHolder {
  
      var inflateView = layoutInflator.inflate(R.layout.single_item, parent, false)
  
      return MyViewHolder(inflateView)
  }
  
  override fun onBindViewHolder(holder: MyViewHolder?, position: Int) {
  
      holder?.moviewTitle?.text = movieList[position].name
      holder?.movieDescription!!.text=   movieList[position].description
      //holder!!.cardImageView!!.background=   movieList[position].image
  
      holder?.onclick(Context, position)
      holder!!.cardImageView.setBackgroundResource(movieList[position].image)
  }
  
  override fun getItemCount(): Int {
  
      return movieList.size
  }
  
  class MyViewHolder(itemView: View?) : RecyclerView.ViewHolder(itemView) {
  
      var moviewTitle: TextView = itemView?.findViewById(R.id.movieTitleTextView)!!
      var movieDescription: TextView = itemView!!.findViewById(R.id.movieDescriptionTextView)
      var cardImageView: CardView = itemView!!.findViewById(R.id.imageCard)
      var share: ImageButton = itemView!!.findViewById(R.id.share)
  
      fun onclick(context: Context, position: Int) {
          cardImageView.setOnClickListener {
  
      }
  
         share.setOnClickListener {
  
             val shareIntent = Intent()
           shareIntent.action = Intent.ACTION_SEND
             shareIntent.putExtra(Intent.EXTRA_TEXT, "ali")
            shareIntent.type = "text/plain"
  
  
             startActivity(Intent.createChooser(shareIntent,"send to"))
  
  }} }}
  </code></pre>