據我所知它總是會自動刷新。你可以做的是將你預覽的當前狀態信息存儲在用於listview的數據類中,並在重新初始化後將其設置爲視頻。
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View rootView= inflater.inflate(R.layout.yourLayout, parent, false);
VideoView videoView = (VideoView) rootView.findViewById(R.id.yourVideoId);
NotifyVideoUpdate(videoView, values[position]);
videoView.seekTo(values[position].CurrentTime);
return rootView;
}
public void NotifyVideoUpdate(VideoView view, VideoModel model){
//no idea how to add a listener to the video preview, but add it here and change
// the value inside of your model
}
我想知道我是否可以通過SetTag()並檢查標記 – user3805809