title: How to override Runnable inside a method?
body: <p>Please, give me an advice for following question.</p>
  
  <p>I have class A &amp; class B
  How to override Runnable inside a method foo in class B?</p>
  
  <pre><code>class A {    
      //some code
      .......    
      protected void foo() {
          //some code
          .......         
          //adding click listener to instance of MyButton
          myButton.show(new Runnable(){
              @Override
              public void run() {
                  .......
              }
          });         
          //some code
          .......
      }    
      //some code
      .......    
  }
  
  class B extends A {    
      @Override
      protected void foo() {
          super.foo();            
          //some NEW code
          .......         
          //adding click listener to instance of MyButton
          myButton.show(new Runnable(){
              @Override
              public void run() {
                  //Copied&amp;Pasted old code
                  .......                 
                  //NEW code
                  .......
              }
          });
      }
  
  }
  </code></pre>
  
  <p>Can I add new code to button's handler (Runnable in myButton) without copying&amp;pasting existing code from super? How?</p>