Вопрос

i want play a lot of videos in a ListView. just like the app called "vine". i use the TextureView and MediaPlayer to display a video. we know that the ListView will reuse the view. because of this mechanism i get a problem. for example : in the visible area i am playing a video A, so ,when i scroll up , video A will be invisible, so i want to play video B , the ListView may reuse the view for play Video A, so ,when i start play video B, first the view will show the image of A , then refresh to content of Video B. that is my problem. i don't know how to clean the content of TextureView . does any body tell me how to solve this problem . thank you very much!

Это было полезно?

Решение

please use removeView(View v) from ViewGroup class. Then re-initiate the view with the right content.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top