String s=var.getSelectedItem().toString(); //Get Value from Spinner
var.setSelection(index); //Set Value to spinner
//Get Previously selected value and Set it again
for (int i=0;i<var.getCount();i++){
if (var.getItemAtPosition(i).toString().equalsIgnoreCase(previousValue))
index=i;
}
var.setSelection(index);
var.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
seektext.setText(""+progress);
//For setting TextView for showing percentage as it changes
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
//To set value
var.setProgress(Value);