I want to show one image view and several text views in Android RecyclerView crying

Asked 2 years ago, Updated 2 years ago, 107 views

Currently, we are using firebase-mlkit to do image labeling. I'd like to print out the images in recyclerview and the corresponding labels as a list when I don't know how many labels will be created in one image. I googled a lot, but I don't know how to do it. Crying. Stackoverflow asks you to receive a view type according to the position and use a different view holder, but the label is flexible, so you don't know which position will have an image. What can I do...

android firebase firebase-mlkit recyclerview

2022-09-22 15:26

1 Answers

In that case, you can create a separate serializable data object and use it through reprocessing.There is a way to use ViewModel globally without having to turn it over to int. Bundle objects have a limitation on the size of data that can be contained, so if there is a lot of data, I don't recommend handing over the list itself to int.


2022-09-22 15:26

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.