I want to display multiple video in listview using video but not able to do this

前端 未结 2 619
被撕碎了的回忆
被撕碎了的回忆 2021-01-16 18:27

This is my code.

public class MainActivity extends Activity {
    ListView list;
    public ArrayList videoList;
    public CustomListAdapter a         


        
2条回答
  •  梦毁少年i
    2021-01-16 18:58

    I think we should not put video view directly in the list, Since each and every view in list are redrawn or invalidated lot of times and if any video is being played and watched by user and he accidentally scrolls it off the screen , Android OS will free up that memory and hence again video will be played from Start. Video.start() will be called again and again

    Best Solution is to provide a thumbnail image of any frame of video . Replace Video view with image view and on click of it open a new screen where put a video view and play on to it.

提交回复
热议问题