Note that there are some explanatory texts on larger screens.

plurals
  1. POupdate seekbar using edittext and decimal numbers
    primarykey
    data
    text
    <p>ok let me explain:</p> <p>i have a seekbar and a edittextbox, the seekbar only goes from 0 to 100, when the user used the seekbar and advance in the editbox it also show the progress, if the user input a number from 0 to 100 the seekbar automatically updates to the number in the edit textbox.</p> <p>here is the code:</p> <pre><code>EditText num1; SeekBar Sb1; num1=(EditText)findViewById(R.id.hoja1E2); Sb1=(SeekBar) findViewById(R.id.seekBar1); Sb1.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) { //---change the font size of the EditText--- num1.setText(String.valueOf(progress)); } }); num1.addTextChangedListener(new TextWatcher(){ @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { try{ //Update Seekbar value after entering a number Sb1.setProgress(Integer.parseInt(s.toString())); num1.setSelection(num1.getText().length()); } catch(Exception ex) {} } }); </code></pre> <p>now my problem is i whant to do the same thing but this time the bar only goes from o to 1, i change a part of the code of the seekbar where i divide the progress whit 100 this way it show in the edittextbox decimal number, but i cant figure out how to introduce decimal number and update the seekbar if some can help my</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload