Last active
March 20, 2017 14:39
-
-
Save sreejithraman/1a32305d75653b2dab4d49fd272147b2 to your computer and use it in GitHub Desktop.
The Missing Documentation: Camera Intents
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
File imageFile; // use this to keep a reference to the file you create so that we can access it from onActivityResult() | |
private void createImageFile() throws IOException { | |
String imageFileName = "image" + System.currentTimeMillis() + "_"; // give it a unique filename | |
File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES); | |
// use this if you want android to automatically save it into the device's image gallery: | |
// File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) | |
imageFile = File.createTempFile(imageFileName, ".jpg", storageDir); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment