title: Function calling from custom OnClickListener
body: <p>I've <strong>Main_Activity.class</strong> file. There I am defining a custom function <strong>myFunction()</strong> . In this function I want to call an externally defined custom <strong>OnClickListener</strong> which will call the function recursively.</p>
  
  <p>In <strong>Main_Activity</strong> the button is  defined as </p>
  
  <pre><code>private Button button;
  .
  .
  button = (Button)findViewById(R.id.button);
  .
  .
  </code></pre>
  
  <p>My <strong>myFunction()</strong> is defined inside <strong>Main_Activity.class</strong>. And inside this function the <strong>OnClickListener</strong> for button is defined. From this <strong>OnClickListener</strong>, I can easily call the <strong>myFunction()</strong>.</p>
  
  <pre><code>private void myFunction(){
    button.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View v) {
                                   myFunction();
              }
          });
  }
  </code></pre>
  
  <p>But I want to define a custom MyClickListenerClass for button and call the myFunction() from that external class.</p>
  
  <p>How can it be possible??</p>