android - Taking pictures without requiring an SD card -
The Android documentation shows you how to capture an image and avoid external storage, but I want my app to work Do not, even if the user does not have an SD card. I just need to temporarily save the file until I upload it. So I create a file and pass the URI with the intent of the camera app: But when I take a picture and hit just fine, the camera app does not return to my app. I'm guessing this because I have passed this file because it's in the directory given by getFilesDir (), which I think is not considered accessible by other apps, is not able to access it. I tried to set the set readable (), but did not fix it. Is there any other directory in internal storage that I can use? * Or there is a way, I can ask the camera app to save the photo in my file directory, and I can read a URI with a content resolver (just like I choose a picture from the gallery). There is nothing to do with the removable SD card in the external memory.
file imgfile = new file (getFilesDir (), imageFileName ); Imgfile.setReadable (true, incorrect); Imgfile.createNewFile (); Intent capture intent = new intent (mediastore.action_IMUNCUCTE); CaptureIntent.putExtra (MediaStore.EXTRA_OUTPUT, Uri.fromFile (imgFile)); StartActivityForResult (capture intent, IMAGE_PICKER_TAKE);
Comments
Post a Comment