title: Android If statement for multiple setOnClickListener
body: <p>I have multiple setOnClickListener and what I want to do is, to make it more simple.</p>
  
  <p>Here's my java </p>
  
  <pre><code> @Override
  public void onActivityCreated(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onActivityCreated(savedInstanceState);
  
      // get the button view
      ImageView foodImg = (ImageView) getView().findViewById(R.id.iconFoods);
      ImageView barsImg = (ImageView) getView().findViewById(R.id.iconBars);
      ImageView roomsImg = (ImageView) getView().findViewById(R.id.iconRooms);
      ImageView wellnessImg = (ImageView) getView().findViewById(R.id.iconWellness);
      ImageView beachesImg = (ImageView) getView().findViewById(R.id.iconBeaches);
      ImageView kidsImg = (ImageView) getView().findViewById(R.id.iconKids);
      ImageView attractionsImg = (ImageView) getView().findViewById(R.id.iconAttractions);
      ImageView shopsImg = (ImageView) getView().findViewById(R.id.iconShops);
      ImageView museumsUmg = (ImageView) getView().findViewById(R.id.iconMuseum);
  
      // set a onclick listener for when the food button gets clicked
      foodImg.setOnClickListener(new OnClickListener() {
  
          // Start new list activity
          public void onClick(View v) {
              Intent mainIntent = new Intent(getActivity(),
                      Food.class);
              startActivity(mainIntent);
          }
      });
  
      // set a onclick listener for when the bars button gets clicked
      barsImg.setOnClickListener(new OnClickListener() {
  
          public void onClick(View v) {
              Intent mainIntent = new Intent(getActivity(),
                      Bars.class);
              startActivity(mainIntent);
          }
      });
  </code></pre>
  
  <p>As you can see I create one setOnClickListener for each ImageView.
  My Question is, how to use if statement for multiple setOnClickListener?
  So when I click ImageView Foods Icon I open the foods activity.
  Thanks before :D</p>