smile2you
smile2you

Reputation: 103

how to clean the content of textureview. i use mediaplayer with textureview in listview

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!

Upvotes: 4

Views: 2542

Answers (1)

KarelG
KarelG

Reputation: 5244

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

Upvotes: 3

Related Questions