Hi I want to bind button with text with seekbar thumb. so that if I move the seekbar thumb the button with dynamic text move along with that.
Please suggest how to do that.
Thanks in advance.
Try Something like below:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_seekbar_test);
seek = (SeekBar) findViewById(R.id.seekBar1);
text = (TextView) findViewById(R.id.textView1);
seek.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onProgressChanged(SeekBar seekBar, int progress,boolean fromUser) {
setTxt(progress);
}
});
}
private void setTxt(int prg)
{
text.setX((float)prg);
}