I need my seekbar to show 1 decimal, ex 4.5. It show as a integer now.
seekBar.setProgress((int)Float.parseFloat(Item.getRating()));
Thx.
I think this help you
aSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
float value = ((float)progress / 10.0);
// value now holds the decimal value between 0.0 and 10.0 of the progress
// Example:
// If the progress changed to 45, value would now hold 4.5
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {}
});