0
I need to use the following method, which is located in the Vodplayeradapter class in an Activity Playeractivity:
public void changeVideo(Video video, boolean playWhenReady) {
finalizePlayer();
this.video = video;
VodSource.getInstance().getImageLoader().get(VodSource.URL_SERVER + this.video.getThumb(), new DescriptionImageListener(thumb));
if(playWhenReady) {
startVideo(playWhenReady);
}
else {
rebuildThumb();
}
}
This class that is abstract is instantiated twice, one in Playlistactivity, that interests me, in this way:
vodPlayerAdapter = new VodPlayerAdapter(view, video, getWindow(), VodPlayerAdapter.PLAYLIST_MODE, true) {
@Override
public void refreshVideoInfor() {
refreshVideoInfo();
}
};
The above method is in Playlistactivity which calls Playeractivity. When I click on a button, it terminates Playlistactivity, and at this point initializes Playeractivity... In Playlistactivity I create an instance of the object of my class Vodplayeradapter, I can use its methods etc, but in this other Activity I can no longer, and because it is an Adapter with information of the previous state that was in Playlistactivity, I don’t think I can give it new again just to use where I want, even tried and it’s wrong. That way, I would like to know some way that could use this method of the class Vodplayeradapter in Playeractivity without creating new instance.