Use of SeekBar Widget in android

Here is its program.

public class MainActivity extends AppCompatActivity {
    EditText e;
    private SeekBar s1, s2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        e=(EditText) findViewById(R.id.editText);
        s1=(SeekBar) findViewById(R.id.seekBar);
        s2=(SeekBar) findViewById(R.id.seekBar2);
    }
    public void perform (View view)
    {
        int n1=s1.getProgress();
        int n2=s2.getProgress();
        e.setText("" + n1 + "," + n2);

    }

}

Leave a Reply