I have a viewholder question for Recyclerview.

Asked 2 weeks ago, Updated 2 weeks ago, 2 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


© 2022 pinfo. All rights reserved.