android disable seek bar for audio controller

后端 未结 4 892
抹茶落季
抹茶落季 2021-02-05 14:37

I used the following seek bar for displacing the progress of my audio.



        
4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-05 15:01

    Just add touch event handler and return true, like example below:

        seekBar.setOnTouchListener(new OnTouchListener(){
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                return true;
            }
        });
    

    User won't be able to touch and change the progress this way.

提交回复
热议问题