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, which interests me, like this:
vodPlayerAdapter = new VodPlayerAdapter(view, video, getWindow(), VodPlayerAdapter.PLAYLIST_MODE, true) {
@Override
public void refreshVideoInfor() {
refreshVideoInfo();
}
};
The above method is in the PlaylistActivity that calls the PlayerActivity. When I click on a button, it finishes the PlaylistActivity, and at this point it initializes the PlayerActivity ... In PlaylistActivity I create an instance of the object of my VodPlayerAdapter class, I can use its methods etc, but in this other activity I can not anymore, and because it is an adapter with information of the previous state that was in the PlaylistActivity, I believe that I can not give new again only to use where I want, even tried and gives error. That way, I'd like to know somehow that I could use this method of the VodPlayerAdapter class in Playeractivity without creating a new instance.