title: is there a way to create condition listener
body: <p>is there a way to create a listener that activates an event under a certain condition(boolean)?</p>
  
  <p>i tried reading about creating custom listeners using interfaces but i dont think it's the answer for my question.</p>
  
  <p>right now in my app i write an if statement everywhere so if i could just create a listener for it, it would be much easier.</p>
  
  <pre><code>set_A==B_Listener(????? {//listener takes place if a==b
          @Override
          public boolean event(View v, MotionEvent e)
          {
               //do something
          }
      });
  </code></pre>