Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm not sure why you're setting tvp and tvc to show the same value, but if you want tvp to update dynamically to match the value of tvc, then you need to move your last bit of code inside your Listener, i.e.:</p> <pre><code>@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { tvc.setText(String.valueOf(progress-100)); TextView tvp = (TextView) findViewById(R.id.textView14); tvp.setText(tvc.getText().toString()); } </code></pre> <p>Or more cleanly:</p> <pre><code>@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { String progress = String.valueOf(progress-100) tvc.setText(progress); tvp.setText(progress); // move the findViewById outside this method, and put it with tvc } </code></pre> <p>Alternatively, if you're having difficulty changing the text in tvc, this may be because you've declared it as <code>final</code>. If this is the case, try making tvc a non-final member variable of your class, i.e. put it outside any method, at the beginning of your class like this:</p> <pre><code>public class MyClass extends Activity { private TextView tvc; ... </code></pre> <p><strong>EDIT:</strong></p> <p>Thanks for the extra info! Try something like this:</p> <pre><code>public class MyClass extends Activity { private TextView tvc; private TextView tvd; private TextView tvp; ... // somewhere here you need to get the TextViews from the Layout ... // missing out lots of code here and skipping straight to onProgressChanged for first seekBar @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { String progress1 = String.valueOf(progress-100) tvc.setText(progress1); String progress2 = tvd.getText().toString; String result = resultOfSomeCalculationUsingTheInputs(); tvp.setText(result); } } </code></pre> <p>In your other SeekBar you would do something similar (set the text of tvd, get the text of tvc, perform calculation, set result as text of tvp)</p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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