iT邦幫忙

0

PagingDataAdapter如何使用putParcelableArrayList???

各位前輩高手您好請問...PagingDataAdapter下該如何使用putParcelableArrayList傳送一堆圖到下一個fragment...因為現在用Paging3...不能用listAdapter...變成currentList不可用...一直湊不出ArrayList裡面要放甚麼???

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyViewHolder {
        val holder=MyViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.gallery_cell2,parent,false))
        holder.itemView.setOnClickListener {
            Bundle().apply {
                putParcelableArrayList("PHOTO_LIST",ArrayList(currentList))
                putInt("PHOTO_POSITION",holder.absoluteAdapterPosition)
                holder.itemView.findNavController().navigate(R.id.action_galleryFragment_to_photoFragment,this)
            }
        }
        return holder
    }
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答