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
int SELECT_PICTURE=1;
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"),SELECT_PICTURE);
public void onActivityResult(int requestCode, int resultCode, Intent data) {
try {
switch (requestCode) {
case SELECT_PICTURE:
Uri selectedImageUri = data.getData();
imgPerview.setBackgroundColor(Color.TRANSPARENT);
LinearLayout.LayoutParams vp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
imgPerview.setLayoutParams(vp);
imgPerview.setScaleType(ImageView.ScaleType.FIT_XY);
imgPerview.setImageURI(selectedImageUri);
uri = selectedImageUri;
}
}
catch (Exception ex)
{}
}