0

i am using a seekbar and its maxvalue is 30 and progress by 1. i need seekbar to start from value 8 so that if we seek to the left the progress should not go less than 8 and it should remain at value 8

SeekBar seek = (SeekBar)dialog.findViewById(R.id.your_dialog_seekbar);
        seek.setProgress(8);
        seek.incrementProgressBy(1);
        seek.setMax(30);

        seek.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

            int topsize;

            public void onStopTrackingTouch(SeekBar seekBar) {
                // TODO Auto-generated method stub


            }


            public void onStartTrackingTouch(SeekBar seekBar) {
                // TODO Auto-generated method stub
            }

            public void onProgressChanged(SeekBar seekBar, int progress,
                                          boolean fromUser) {
                TextView t1=(TextView)dialog.findViewById(R.id.df);
                t1.setText(String.valueOf(progress));
                TextBox = (TextView)findViewById(R.id.t9);
                //   TextBox.setTextSize(40);
                TextBox.setTextSize(TypedValue.COMPLEX_UNIT_SP, progress);



            }
        });


        dialog.show();

XML IS

<SeekBar
        android:id="@+id/your_dialog_seekbar"
        android:layout_width="0dp"
        android:layout_weight="3"
        android:paddingTop="7dp"

        android:layout_height="wrap_content"
        >
    </SeekBar>

1 Answers1

0

Basically you can not set min value to seekbar

So you can not do like this seek.setMax(7);

but of course you can handle it see this how you can handle it

Community
  • 1
  • 1
Ajay Pandya
  • 2,417
  • 4
  • 29
  • 65