title: Android: Handler.postDelayed doesn't stop
body: <p>I am unable to stop handler.postDelayed from example below. It simply continues to do function after 1 second, and doesn't stop when switch is off:</p>
  
  <pre><code>    mySwitch.setChecked(false);
      mySwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
  
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
              final Handler handler = new Handler();
  
              final Runnable r = new Runnable() {
                  public void run() {
                      myClient.SendData("AA");
                      handler.postDelayed(this, 1000);
                  }
              };
              if (isChecked){
                  handler.postDelayed(r, 1000);
              }
              else {
                  handler.removeCallbacks(r);
              }
          }
      });
  </code></pre>