title: Create a "like/unlike" functionality for ImageView
body: <p>I would like to create a like/unlike functionality like Facebook and Instagram.</p>
  
  <pre><code>&lt;ImageView
     android:onClick="onLikeClick"
     android:focusable="true"
     android:clickable="true"
     android:background="@drawable/your_feed_post_holder_state_fire"
     android:id="@+id/imageView"
     android:layout_width="25dp"
     android:layout_height="25dp" /&gt;
  </code></pre>
  
  <p>Here is what I'm doing, </p>
  
  <pre><code>Boolean clicked = true;
  
  
  public void onLikeClick(View view) {
      if (clicked) {
          imageView.setImageResource(R.drawable.like_selected);
      } else {
          imageView.setImageResource(R.drawable.like_unselected);
      }
  }
  </code></pre>
  
  <p>The icon changes on first click, but on second click nothing happens.</p>
  
  <p>Once a user presses on the ImageView a new image will replace, but if the user presses on the ImageView it will put the default image and so on back and forth.</p>