sb.setOnSeekBarChangeListener(new OnSeekBarChangeListener() { @Override public void onStopTrackingTouch(SeekBar seekBar) { // TODO Auto-generated method stub } @Override public void onStartTrackingTouch(SeekBar seekBar) { // TODO Auto-generated method stub } @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { // TODO Auto-generated method stub changeP((float)progress/100); } }); } //设置屏幕亮度 private void changeP(float f){ WindowManager.LayoutParams param = getWindow().getAttributes(); //设置屏幕亮度 param.screenBrightness = f; getWindow().setAttributes(param); }