title: Android Imageview in Listview onClick change image doesn't work properly
body: <p>I have a ListView and in every single ListviewItem there is an ImageView with a little star (for marking it as favourite). Therefore I put an OnClickListener to the ImageView on every item in the custom ArrayAdapter.</p>
  
  <pre><code>imgStar.setOnClickListener(new OnClickListener() {
          @Override
          public void onClick(View v) {
              Bitmap bitmap = ((BitmapDrawable)imgStar.getDrawable()).getBitmap();
              Bitmap bitmap2 = ((BitmapDrawable)(context.getResources().getDrawable(R.drawable.ic_action_not_important))).getBitmap();
  
              if(bitmap != bitmap2) {
                      imgStar.setImageResource(R.drawable.ic_action_not_important);
              } else {
                      imgStar.setImageResource(R.drawable.ic_action_important);
              }
          }
      });
  </code></pre>
  
  <p>The problem: When I get some items and click for example on the star of the first item, the image changes as it should but a few items lower the image changes too o.O
  I tested it with some code: The thing that won't get into my head is it is only changing the image (on the other item below), code that would be executed in the onclick is only executed for the item I really click not for the one where the image changes too.</p>
  
  <p>Why does the image of a random other item in the list change also? I hope someone can help me.</p>
  
  <p>Custom Adapter Constructore Code</p>
  
  <pre><code>public LinkArrayAdapter(Context con, int textViewResourceId) {
      super(con, textViewResourceId);
      context = con;
  
  }
  </code></pre>