title: How to select multiple images from gallery in android?
body: <p>I am making a project in which i want to select multiple photos from gallery and want to save that in imageview array.
  I am able to import single image and save at imageview
  Can anyone tell please how may i import multiple images and save in array or different imageviews?</p>
  
  <pre><code>MainActivity extends Activity implements OnClickListener {
  
      Button addphoto, save;
      ImageView img1[];
      Bitmap yourbitmap, resized;
      int RESULT_LOAD_IMAGE1 =1;
  
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          addphoto = (Button)findViewById(R.id.add);
          img1[0] = (ImageView)findViewById(R.id.imageView1);
          save = (Button)findViewById(R.id.save);
          addphoto.setOnClickListener(this);
          save.setOnClickListener(this);
      }
  @Override
      public void onClick(View arg0) {
          // TODO Auto-generated method stub
          switch(arg0.getId()){
          case R.id.add:
              Intent intent = new Intent();
              intent.setType("image/*");
              intent.setAction(Intent.ACTION_GET_CONTENT);
              startActivityForResult(Intent.createChooser(intent, "Select Picture"), RESULT_LOAD_IMAGE1);
              break;
              }
  
      @Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          // TODO Auto-generated method stub
          super.onActivityResult(requestCode, resultCode, data);
  
          if (requestCode == RESULT_LOAD_IMAGE1 &amp;&amp; resultCode == RESULT_OK
                  &amp;&amp; null != data) {
              Uri selectedImage = data.getData();
              String[] filePathColumn = { MediaStore.Images.Media.DATA };
  
              Cursor cursor = getContentResolver().query(selectedImage,
                      filePathColumn, null, null, null);
              cursor.moveToFirst();
  
              int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
              String picturePath = cursor.getString(columnIndex);
              cursor.close();
  
              try {
                  yourbitmap = BitmapFactory.decodeFile(picturePath);
                  resized=    Bitmap.createScaledBitmap(yourbitmap, 200,300, true);
  
  
                  img1[0].setImageBitmap(resized);
              } catch (Exception e) {
                  e.printStackTrace();
              }
  
          }
  
  
  
      }
  
  }
  </code></pre>