Так что, если вы настроите правильные параметры, вы будете хороши, но я все равно рекомендую извлечь его для простоты обновления до заводской настройки, как это.

у поделиться текстом в моемCardView используя общий доступ, используя kotlin, но есть проблема с последней строкой в ​​коде, в kotlin код

 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)))

вот проблема в коде

startActivity(Intent.createChooser(shareIntent, getResources().getText(R.string.send_to)))

Помогите мне, пожалуйста

увидеть изображения, чтобы понять меня

картинки

https://ibb.co/jQwYXw

https://ibb.co/id0tXw

https://ibb.co/fbCU5G

полный код адаптера

class MyAdapter(context: Context, listItem: ArrayList<com.EliteTeam.comedytaste.Model.Movie>) : RecyclerView.Adapter<MyAdapter.MyViewHolder>() {

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"))

}} }}

Ответы на вопрос(3)

Ваш ответ на вопрос