title: how to change a imageButton and check the state
body: <p>I have a play/pause and a like/not liked button. I believe how it should work is that I check the state of the image button and whatever it is not when it is pressed it should change the image. the buttons also change actions based on the state of the button (play button stuff is paused , paused stuff is playing yada yada)</p>
  <p>so currently I have</p>
  <pre><code>
          // if the id of the song matches any of the 
          holder.likes.setOnClickListener(new View.OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  holder.likes.setImageResource(R.drawable.like_favorite);
  
              }
          });
  
  
      }
  </code></pre>
  <p>which works BUT I have no way to change it back. I have seen it mentioned here using</p>
  <pre><code>if ((int) image.getTag() == R.drawable.apicture) {
        // do your stuff
   }
  </code></pre>
  <p>but this hasn't worked for me ( I should mention that I set up the tags using .setTag(I think) and it didn't work)</p>