Created
April 11, 2014 05:00
-
-
Save kzim44/10441631 to your computer and use it in GitHub Desktop.
Android - create world readable file in app private file directory. Useful for capturing images with the stock camera app.
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
//Remove if exists, the file MUST be created using the lines below | |
File f = new File(getFilesDir(), "Captured.jpg"); | |
f.delete(); | |
//Create new file | |
FileOutputStream fos = openFileOutput("Captured.jpg", Context.MODE_WORLD_WRITEABLE); | |
fos.close(); | |
//Get reference to the file | |
File f = new File(getFilesDir(), "Captured.jpg"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment