title: Android cyclic listeners
body: <p>I've got a small issue in my code:</p>
  
  <p>I've a <code>SeekBar</code> and an <code>EditText</code> in a layout.
  What I want to do is to set the <code>EditText</code> value when the <code>SeekBar</code> changes and set the <code>SeekBar</code> progress when the <code>EditText</code> changes.</p>
  
  <p>So far, I've the following code:</p>
  
  <pre><code>    SeekBar seek_coagulation = (SeekBar) findViewById(R.id.seek_coagulation);
      EditText edit_coagulation = (EditText) findViewById(R.id.edit_coagulation);
      seek_coagulation.incrementProgressBy(1);
      seek_coagulation.setMax(1000);
      seek_coagulation.setOnSeekBarChangeListener( new OnSeekBarChangeListener() {
          public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
          {
              double value = progress / 100.0;
              edit_coagulation.setText(String.valueOf(value));
          }
  
          public void onStartTrackingTouch(SeekBar seekBar)
          {
          }
  
          public void onStopTrackingTouch(SeekBar seekBar)
          {
          }
      });
      edit_coagulation.addTextChangedListener(new TextWatcher() {
          public void afterTextChanged(Editable s)
          {
              double value = (s != null &amp;&amp; s.toString().length() &gt; 0) ? Double.parseDouble(s.toString().replace(',', '.')) : 0D;
              int progress = (int) (value * 100);
              seek_coagulation.setProgress(progress);
          }
  
          public void beforeTextChanged(CharSequence s, int start, int count, int after)
          {
          }
  
          public void onTextChanged(CharSequence s, int start, int before, int count)
          {
          }
      });
  </code></pre>
  
  <p>The first case (<code>SeekBar</code> to <code>EditText</code>) works well, but not the second.
  The problem is that it is a loop (<code>SeekBar</code> to <code>EditText</code> to <code>SeekBar</code> to <code>EditText</code> etc.).</p>
  
  <p>Is there a way to fix that ?</p>