android - Default Camera Activity Not Finishing Upon OK button press -


I'm calling default camera from my activity and then handling onActivityResult My code works fine on LG's partner, The picture is not confirmed when taken. However, when I run the same app on the Nexus S, it prompts me with "OK", "retake", or "cancel" before returning to my activity. When working "cancel", when returning to my activity without saving a picture, there is no effect in "OK", even my activity is not coming back.

My code below:

  Private Zero Capture Image () {String Status = Environment .getExternalStorageState (); If (Environment.MEDIA_MOUNTED.equals (state)) {file path = new file (environment .getExternalStorage directory) GetPath () + "/ Images" + (New UserContextAdapter (this)). GetUser () + "/") ; Path.mkdirs (); File file = new file (path, "image_story_" + mRowId.toString () + ".jpg"); NewImageUri = Uri.framefile (file); Intent intention = new intent (android.provider.MediaStore.ACTION_IMAGE_CAPTURE); Intent.putExtra (MediaStore.EXTRA_OUTPUT, newImageUri); StartActivityForResult (intent, CAPTURE_IMAGE); }} @ Override public wide on activative result (int code code, intent intent) {switch (requestcode) {case capture_IMAG: switch (result code) {case 0: log. I ("Capture", "Canceled by User"); break; Case 1: MIMAUU = New Image Yuri; SetImageFromUri (); }}    

I think I had the same problem.

If the path to save the image is not correct, then the camera will not return to your app. Once I'm sure that the directory exists, everything worked fine. Make sure that the directory exists, then it should work.

- Edit -

I have just seen that you path.mkdirs (); But I think it does not work as you can read in the Android Dock "Note that this method does not throw the IOException over failure. The caller should check the return value." Please make sure that the directory actually exists or not.

hth

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -