How to open a dialog box to search for a file on Android? A FileDialog

0

My question is about opening files in my Android application, such as uploading image from mobile to the server where I first need to choose the image on my phone. I would like to know what I need to use to open a FileDialog , as in C # if I am not mistaken, on Android to choose an image or text file whatever it is and load it into my application so I can work with it , Modify anyway).

    
asked by anonymous 03.06.2017 / 04:52

1 answer

2

You can use this code that will return the URI of the image selected by Picker. Then you can use this Uri to load the image or send it to another place.

Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"), PICK_IMAGE);
    
03.06.2017 / 13:23