I am referring this code in my project..code snippet. Here i can able to upload one image succesfully..Now i have to upload more than one image..How can i do that one..I di
You can use $id = uniqid();
in order to get different id for the images.
In your java code, change private int PICK_IMAGE_REQUEST1 = 1;
to private int PICK_IMAGE_REQUEST1 = 2;
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case PICK_IMAGE_REQUEST:
if (requestCode == PICK_IMAGE_REQUEST && resultCode == RESULT_OK & null != data) {
Uri filePath = data.getData();
try {
bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), filePath);
//bitmap1 = MediaStore.Images.Media.getBitmap(getContentResolver(), filePath);
imageView.setImageBitmap(bitmap);
} catch (IOException e) {
e.printStackTrace();
}
}
break;
case PICK_IMAGE_REQUEST1:
if (requestCode == PICK_IMAGE_REQUEST1 && resultCode == RESULT_OK) {
Uri filePath = data.getData();
try {
//bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), filePath);
bitmap1 = MediaStore.Images.Media.getBitmap(getContentResolver(), filePath);
//imageView.setImageBitmap(bitmap);
imageView1.setImageBitmap(bitmap1);
} catch (IOException e) {
e.printStackTrace();
}
}
}