I’m getting a NullPointerException when I use ACTION_IMAGE_CAPTURE to take a picture

Turns out the stock camera application doesn’t send EXTRA_OUTPUT, which is why it’s null. However, some camera apps (like the hero) do. Awesome.
So the answer is to specify EXTRA_OUTPUT. The nexus one camera app will save the image to that location. Then in onActivityResult() check if the intent is null. If it isn’t, use data.getData(), and if it is then use the location specific in EXTRA_OUTPUT via a constant and insert it into the Mediastore. Urgh.

Leave a Comment