android-adapter

RecyclerView - changing selected item icon needs two clicks to work

落爺英雄遲暮 提交于 2021-01-28 06:08:10
问题 I am working on a mailing app, in which user can send the same mail to multiple contacts. When I open the contacts list I want to be able to click on the user and his profile picture should be replaced with checked icon. When I click to select a user the icon flickers and it does not change the first time I click on it . Second time I click on it the image still flickers, but then changes to checked , and every next time I click on that user it will flicker but do what I want - become checked

Android Kotlin New intent on click event from recycler view

為{幸葍}努か 提交于 2020-12-13 03:13:36
问题 I've just started learning android development with Kotlin. I have a recycler view that lists items. I'm trying to create onClick event for the item and then start a new intent and pass along the item id. I'm getting an error when trying to instantiate the Intent "None of the following functions can be called with the arguments supplied". I think it's because I cannot access the context of the view? override fun onBindViewHolder(holder: ViewHolder, position: Int) { holder.id = events[position

Android Kotlin New intent on click event from recycler view

回眸只為那壹抹淺笑 提交于 2020-12-13 03:11:33
问题 I've just started learning android development with Kotlin. I have a recycler view that lists items. I'm trying to create onClick event for the item and then start a new intent and pass along the item id. I'm getting an error when trying to instantiate the Intent "None of the following functions can be called with the arguments supplied". I think it's because I cannot access the context of the view? override fun onBindViewHolder(holder: ViewHolder, position: Int) { holder.id = events[position