title: How to display multiple image view in android studio
body: <p>I want to display multiple image view which the images are taken from camera. However, I only know how to display 1. Anyone know how to display multiple image view? Thanks for help!</p>
  
  <pre><code>public class ItemRegisterActivity extends AppCompatActivity {
  private static final int CAMERA_REQUEST = 1888;
  private ImageView imageView;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_item_register);
      this.imageView = (ImageView)this.findViewById(R.id.imageView1);
      imageView.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
              startActivityForResult(cameraIntent, CAMERA_REQUEST);
          }
      });
  
  }
  
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      if (requestCode == CAMERA_REQUEST &amp;&amp; resultCode == Activity.RESULT_OK) {
          Bitmap photo = (Bitmap) data.getExtras().get("data");
          imageView.setImageBitmap(photo);
      }
  }
  }
  </code></pre>
  
  <p>Actually I have a solution like this</p>
  
  <pre><code>public class ItemRegisterActivity extends AppCompatActivity {
  private static final int CAMERA_REQUEST = 1888;
  private ImageView imageView1,imageView2,imageView3,imageView4;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_item_register);
      this.imageView1 = (ImageView)this.findViewById(R.id.imageView1);
      imageView1.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
              startActivityForResult(cameraIntent, 1);
          }
      });
      this.imageView2 = (ImageView)this.findViewById(R.id.imageView2);
      imageView2.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
              startActivityForResult(cameraIntent, 2);
          }
      });
      this.imageView3 = (ImageView)this.findViewById(R.id.imageView3);
      imageView3.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
              startActivityForResult(cameraIntent, 3);
          }
      });
      this.imageView4 = (ImageView)this.findViewById(R.id.imageView4);
      imageView4.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
              startActivityForResult(cameraIntent, 4);
          }
      });
  }
  
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      if (requestCode == 1 &amp;&amp; resultCode == Activity.RESULT_OK) {
          Bitmap photo = (Bitmap) data.getExtras().get("data");
          imageView1.setImageBitmap(photo);
      }
      if (requestCode == 2 &amp;&amp; resultCode == Activity.RESULT_OK) {
          Bitmap photo = (Bitmap) data.getExtras().get("data");
          imageView2.setImageBitmap(photo);
      }
      if (requestCode == 3 &amp;&amp; resultCode == Activity.RESULT_OK) {
          Bitmap photo = (Bitmap) data.getExtras().get("data");
          imageView3.setImageBitmap(photo);
      }
      if (requestCode == 4 &amp;&amp; resultCode == Activity.RESULT_OK) {
          Bitmap photo = (Bitmap) data.getExtras().get("data");
          imageView4.setImageBitmap(photo);
      }
  }
  }
  </code></pre>
  
  <p>Is there any other way to do this? Must use recycle view? Thanks!</p>