I have a viewholder question for Recyclerview.

Asked 2 years ago, Updated 2 years ago, 24 views

When I tried to call the camera in the itemView onclick in the viewholder part of Recyclerview, (Activity) itemView.context Classcasting exception occurs in this part, but is startActivityForResult not available in viewholder? I want to take a picture of each list view item and make it appear in the image view, but it doesn't work well.

android

2022-09-20 14:44

1 Answers

Click events that occur in viewholder via listener

Let activity handle it (photographing)

You can reflect the result on the list in recyclerview and notify it.


2022-09-20 14:44

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.