Last active
July 19, 2016 12:30
-
-
Save MichaelPolla/deb2ec0b453a83f0b02a22a44c1ec865 to your computer and use it in GitHub Desktop.
[Android] Open the document app on the phone to pick a picture (or any kind of files)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final int PICK_IMAGE = 1; // number that identify the request (can be any number) | |
//... | |
// Called e.g. when clicking on a button | |
public void addPicture() { | |
Intent intent = new Intent(); | |
intent.setType("image/*"); // the type of data we are interested of | |
intent.setAction(Intent.ACTION_GET_CONTENT); | |
startActivityForResult(Intent.createChooser(intent, "Select picture"), PICK_IMAGE); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment