Skip to content Skip to sidebar Skip to footer

Android Samsung: Camera App Won't Return Intent.getdata()

I am developing an app, where an image taken from the native camera app. is to be shown to the user. The code I did is: /* Intent */ Intent intent = new Intent('android.media.actio

Solution 1:

See Specify filename for picture to be taken for code to specify an EXTRA_OUTPUT parameter for the Intent which lets you specify a filename for the picture. Remember the filename when the activity result is called and use that if the intent.getData is NULL

And if you read the other comments in that bug report, you'll realize how many problems that picture taking on Android has.

Solution 2:

Your best bet is to generate a file path you want to save the picture to and store it in a member variable. Then, when calling camera activity, put it (as Uri) in the MediaStore.EXTRA_OUTPUT extra.

Be sure to override onSaveInstanceState() and onRestoreInstanceState() and save/restore this path properly. This will make sure you'll still have it if the system decides to restart your activity in the meantime (which is very possible due to orientation changes and/or out of memory conditions).

Post a Comment for "Android Samsung: Camera App Won't Return Intent.getdata()"