How to capture more than one image in Android?

I want to re-render 4 images and save them in my custom folder and want to display them on screen in lower format.

_________________________________________
| Image1        |     Image2             | 
|               |                        |
|_______________|________________________|
| Image3        |    Image4              |
|               |                        |
|_______________|________________________|

MediaStore.ACTION_IMAGE_CAPTURE

      

Using this I can only get one image and return, and in order to accept it I have to open it again. I want to render 4 images in one event and display it on the screen.

btn_takeimg.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
            File file = Environment.getExternalStorageDirectory();
            File imgFile = new File(file+File.separator+"Images"+File.separator+"images30.jpg");
            Uri uriSavedImage= FileProvider.getUriForFile(CameraApp.this,
                    BuildConfig.APPLICATION_ID + ".provider",imgFile);
            camera.putExtra(MediaStore.EXTRA_OUTPUT, uriSavedImage);
            startActivityForResult(camera, 1);
        }
    });

}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if(requestCode == 1 && resultCode == Activity.RESULT_OK){
        Toast.makeText(this, "Succesfully Captured", Toast.LENGTH_SHORT).show();
    }
    else {
        Toast.makeText(this, "Error While capturing image`", Toast.LENGTH_SHORT).show();
    }
}

      

or if it can be implemented in another way.

+3
java android android-intent camera


source to share


No one has answered this question yet

Check out similar questions:

23498
Why is processing a sorted array faster than processing an unsorted array?
3606
Close / hide Android soft keyboard
3295
Why is the Android emulator so slow? How can we speed up the development of an Android emulator?
3288
Correct use cases for Android UserManager.isUserAGoat ()?
2643
Why is printing "B" significantly slower than printing "#"?
2609
Is there a unique identifier for an Android device?
2510
How to persist android activity state by persisting instance state?
2284
How can I fix 'android.os.NetworkOnMainThreadException'?
2097
Is there a way to run Python on Android?
1270
How to pass data between activities in an Android app?



All Articles
Loading...
X
Show
Funny
Dev
Pics