title: How to disable momentarily onClick event of ImageView and Button in Android Studio
body: <p>I have 2 elements:</p>
  
  <pre><code>Button answer;
  Imageview play;
  </code></pre>
  
  <p>When 'answer' is clicked - the app records the user.
  When 'play' is clicked - the app plays a clue to the user.
  So when one of the above is clicked, the other should be disabled and not allow an onclick event.
  Problem is - I've tried both setClickable() and setEnabled() but they don't do what I expected them to do.
  Also, I've tried using a boolean flag, but it also didn't do the trick.
  What am I doing wrong?
  Here is the attempt with the boolean flag:</p>
  
  <pre><code>answer.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
          if(mIsAudioResourcesFree)
          {
              mIsAudioResourcesFree = false;
  //RECORDS AND STOPS RECORDING
              mIsAudioResourcesFree = true;
          }
      }
  });
  
  play.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  if(mIsAudioResourcesFree)
                  {
                      mIsAudioResourcesFree = false;
                      //PLAYS SOME SHORT AUDIO
                      mIsAudioResourcesFree = true;
                  }
              }
          });
  </code></pre>