SeekBar listener Android Example Source

SeekBar setOnSeekBarChangeListener Example. Change TextView font size by SeekBar Example.

        TextView mTextView01 = (TextView)findViewById(R.id.textView01);
 
        SeekBar  mSeekBarTexSize = (SeekBar)findViewById(R.id.seekBarTextSize);
        mSeekBarTexSize.setMax(100);
        mSeekBarTexSize.setProgress(25);
 
        mSeekBarTexSize.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            public void onProgressChanged(SeekBar seekBar, int progress,
                    boolean fromUser) {
            	mTextView01.setTextSize((float)progress);
            }
 
            public void onStartTrackingTouch(SeekBar seekBar) {}
            public void onStopTrackingTouch(SeekBar seekBar) {}
        });
This entry was posted in Android Examples Code and tagged , , . Bookmark the permalink.


Comments are closed.



5,527 views