How i Can Enable Next And Prev Button in Media Controller in Android

谁都会走 提交于 2019-12-11 04:38:21

问题


****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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!