问题
****I am developing Video Player and i am using Media_controller here is the link below****
https://github.com/brightec/ExampleMediaController/blob/master/src/uk/co/brightec/example/mediacontroller/VideoControllerView.java
But in this I visible next and prev button and when I call to set Prev Next Listeners Method then its still not working both next and prev button code is here below
mNextButton = (ImageView) v.findViewById(R.id.next);
if (mNextButton != null && !mFromXml && !mListenersSet) {
mNextButton.setVisibility(View.VISIBLE);
setPrevNextListeners(mNextListener,null);
}
mPrevButton = (ImageView) v.findViewById(R.id.prev);
if (mPrevButton != null && !mFromXml && !mListenersSet) {
mPrevButton.setVisibility(View.VISIBLE);
setPrevNextListeners(mPrevListener,null);
}
回答1:
Use like this Way...Maybe help you
mediacontroller.setPrevNextListeners(new View.OnClickListener() {
@Override
public void onClick(View v) {
// next button clicked
}
}, new View.OnClickListener() {
@Override
public void onClick(View v) {
// prev button clicked
}
});
mediacontroller.show(10000);
来源:https://stackoverflow.com/questions/47918763/how-i-can-enable-next-and-prev-button-in-media-controller-in-android