title: how to pass function to another class and call if from there in android studio?
body: <p>i want to have a function in one class, 
  that does an animation and then notify''s a function that is passed to it which is in another class. 
  how do i do that ?</p>
  
  <p>exapmle:
  in my scanning barcode activity i have: </p>
  
  <pre><code> public void callbackFNC () {
      //this is the callback bunction
  }
  </code></pre>
  
  <p>from scanning barcode activity i'm calling a function that is in another activity like (i want to pass the callback that is in scanning barcode activity as parameter there) : </p>
  
  <pre><code>loadToastModule loadToastMD = new loadToastModule();
  loadToastMD.doEvent(toastModel);
  </code></pre>
  
  <p>then in doEvent that sits in LoadToastModule.class function i want to have</p>
  
  <pre><code>public void doEvent(LoadToast toastModel) {
          toastModel.error();
  
  
  
          new CountDownTimer(0, 500) {
  
              public void onTick(long millisUntilFinished) {
                  //do nothing
              }
  
              public void onFinish() {
  
                 ****DO THE CALLBACK HERE
                 ****DO THE CALLBACK HERE
  
              }
          }.start();
  </code></pre>
  
  <ul>
  <li>it is important to me that i'll use it like this instead of just calling a PACIFIC function because in the future i want to use the same function with different callback.</li>
  </ul>
  
  <p>thnx !!!</p>