How to make "Select Image From Gallery or Camera" in Android

I want to make "Select Image From Gallery or Camera". You can say there are a lot of library on the internet for this. I know but I have an another problem. I can make both select images from gallery and camera capture. But camera resulted in image rotated after the capture. I solved the problem with rotating. Now I want to show an imageview that image. Some devices didn't show the image in imageview(Samsung Note 3 Android version 5.0). I made a lot of searches and find advice. I applied the recommendations. But I can not solve that problem. Please help me.

Same problem happened with me. I am not able to see captured images on Samsung and MI devices mostly.

By using this library I have solved my issue.

Use Cloth Face Coverings to Help Slow Spread, Our guide to different types of face coverings and step-by-step instructions on how to make them. Make eye contact. Meet your kissing partner's eyes and give them a little smile to show that you're ready for some action. You can also gently lean your forehead against your kissing partner's, put your hand on their face, touch their leg, or even give them a quick peck on the lips before you really start kissing.

On which version of android image is not shown in imageview

If it is Android N you give provider in Manifest

add this code to your manifest

                android:resource="@xml/provider_paths" />


<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="">
    <external-path name="external_files" path="."/>

provider_paths is in resource-xml folder

How to Make a Face Mask at Home Easy, We are welcoming fabric masks from our community as we prepare for COVID-19​. Thank you so much for your interest and care. Learn how to do just about everything at eHow. Find expert advice along with How To videos and articles, including instructions on how to make, cook, grow, or do almost anything.

So that the user can choose an image of the gallery do this in your Activity :

The method that shows the gallery :

 private static final int SELECT_PHOTO = 1;

 public void showGallery() {
        Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
        startActivityForResult(photoPickerIntent, SELECT_PHOTO);

And this will be called when the user picks one image, the image path, if any, will be stored in imagePath

private String imagePath;

        protected void onActivityResult(int requestCode, int resultCode, Intent data) {
            super.onActivityResult(requestCode, resultCode, data);
            imagePath = "";
            if (requestCode == SELECT_PHOTO && resultCode == RESULT_OK) {
                Uri selectedImage = data.getData();
                String[] filePathColumn = {MediaStore.Images.Media.DATA};

                Cursor cursor = getContentResolver().query(selectedImage,
                        filePathColumn, null, null, null);

                if (cursor != null) {
                    int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
                    imagePath = cursor.getString(columnIndex);
                    //Here you can call a method that loads the image and 
                    //show it in an ImageView

you will need a permission in your manifest :

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

Make Fabric Face Mask at home, You can make two sizes: Adult or Child. 1. Put right sides of cotton fabric together o Cut 9x6 (Adult) or 7.5 x 5 (Child). 2. Starting at the center of the bottom edge,  Making soap at home is a practical and satisfying skill to learn. Whether you'd like a natural alternative to store-bought soap or you're a crafty person looking for a new creative venture, making soap is fun and not always as difficult as you might think.

It might be too late for the answer but I hope it will help others.

Instead of using external libraries it is better to create your own layout and use it.

Step 1: Create layout for options.


<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android=""


            android:text="Take Photo"
            app:layout_constraintTop_toTopOf="parent" />

            android:text="Choose Image"
            app:layout_constraintTop_toTopOf="@+id/tvClickImageText" />



Step 2: Create a BottomSheetDialog where you can inflate the layout and configure it.

public class DialogImageChooser extends BottomSheetDialogFragment {

static {

View view;
//    DialogNationalitySelectionBinding mBinding;
Context mContext;
private bottomSheetListener mListener;
TextView tvClickImageText, tvChooseGalleryText;

public DialogImageChooser() {

public DialogImageChooser(@NonNull Context context, bottomSheetListener mListener) {
    this.mListener = mListener;
    mContext = context;

public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    view = inflater.inflate(R.layout.image_choose_bottom_sheet, container, false);

    tvClickImageText = view.findViewById(;
    tvChooseGalleryText = view.findViewById(;

    tvClickImageText.setOnClickListener(v -> {

    tvChooseGalleryText.setOnClickListener(v -> {

    return view;

public interface bottomSheetListener {
    void onCardClicked(String option);

Step 3: Finally in the Activity just make a call for Dialog.

ivItemImage.setOnClickListener(v -> {
        new DialogImageChooser(YourActivity.this, selectedOption -> {
            if (selectedOption.equalsIgnoreCase("camera")) {
            } else if (selectedOption.equalsIgnoreCase("gallery")) {
                Intent i = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
                startActivityForResult(i, SELECT_IMAGE);
        }).show(getSupportFragmentManager(), "add_photo_dialog");

That's it. Custom "Select Image From Gallery or Camera Dialog" is integrated without use of any external libraries.

How to make a face mask: 4 easy ways to make DIY face coverings , Wearing a fabric face mask when you're out in public is one way you can help slow the spread of the new coronavirus. You can easily make  Make your mask. 1. Cut the bottom off a folded coffee filter. Keep the top part -- you'll need it for the filter in your mask.

Coronavirus: How to make your own face mask, To make filling deviled eggs so much easier, we recommend grabbing a set of piping bags ($24) to help your yolks stay neat. You can even jazz up the look of your deviled eggs by using different piping tips.

How to make a Face Mask, Making smoothies is hardly rocket science and there are plenty of recipes out there, but here are some tips for creating your own smoothie and then following are 5 smoothie recipes to get you started!

[PDF] How to make a Face Mask, Make it a malt: It’s easy to mimic those old-fashioned malted milks you get at a restaurant. Simply pick up malted milk powder from the store. Simply pick up malted milk powder from the store. (It’s usually found near the breakfast and chocolate milk mixes.)

  • Samsung Note 3, Android version 5.0
  • This does not correspond to the question, it serves to share files of your application, not to select an image