title: imageview onClick
body: <p>i want to make a game that when the user clicks all image view the layout would intent to another level.So far i can't find the right code.Would you please help me?</p>
  
  <p>here's some of my codes.</p>
  
  <pre><code>ChairA1.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
               ChairA1.setImageResource(R.drawable.chair);
  
          }
      });
  
       ChairA2.setOnClickListener(new View.OnClickListener() {
  
              @Override
              public void onClick(View v) {
                   ChairA2.setImageResource(R.drawable.chair);
  
              }
          });
  
       ChairA3.setOnClickListener(new View.OnClickListener() {
  
              @Override
              public void onClick(View v) {
                   ChairA3.setImageResource(R.drawable.chair);
  
              }
          });
  
       ChairA4.setOnClickListener(new View.OnClickListener() {
  
              @Override
              public void onClick(View v) {
                   ChairA4.setImageResource(R.drawable.chair);
  
              }
          });
  
  
  
   //here i where i would put the codes
  </code></pre>