For controlling the exoplayer from the Home_F.java,
First Create a method similar to below in VideoList_F class
public void setExoPlayWhenReady(boolean playWhenReady){
exoPlayer.setPlayWhenReady(playWhenReady);
}
you need to have an interface defined as below in Home_F class
private Home_F_Listener homeFListener = null;
interface Home_F_Listener {
public void setPlayWhenReady(boolean playWhenReady);
}
Then in the onAttach overrides method of Home_F fragment, extract the instance of Home_F_Listener from the context
if(context instanceof Home_F_Listener){
homeFListener = (Home_F_Listener) context ;
}
Then call the interface method from the Home_F class when required as below
if(homeFListener != null){
homeFListener.setPlayWhenReady(false)
}
Then implement the interface in the parent activity where that fragment is inflated. Also your parent activity should hold the instance of the VideoList_F fragment.
public class ParentActivity extends Activity implements Home_F_Listener {
//other code
@Override
public void setPlayWhenReady(boolean playWhenReady){
videoList.setExoPlayWhenReady(playWhenReady);
}
//other code
}