5

I received the following crash report in my Android application when trying to call the ACTION_IMAGE_CAPTURE intent. This code has been running in my app for months with no issues. I am guessing this is something specific to a certain type of phone but unfortunately Google does not provide me with any additional information outside the stack trace. Any ideas what could have caused this crash report?

Stack Trace

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.media.action.IMAGE_CAPTURE }
    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1409)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
    at android.app.Activity.startActivityFromChild(Activity.java:3067)
    at android.app.Activity.startActivityForResult(Activity.java:2847)

Producing Code

Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, MY_CAMERA_ACTIVITY_REQUEST_CODE);

Manifest Entries

<uses-sdk android:minSdkVersion="7" />
<uses-feature android:name="android.hardware.camera" />

1 Answers1

8

A few things come to mind 1.Could be a tablet, the kindle fire does not have a camera. 2. A phone that does not have a camera 3. No SD card installed

I agree you would think it would be a safe operation to call the image capture intent but with so many devices running Android it's impossible to know what device your app is running on.

Schreinbo
  • 235
  • 1
  • 5
  • 1
    Thanks. I misunderstood the purpose of "uses-feature", thinking the Android Market would filter out my application if the device did not have a camera. "Declared elements are informational only, meaning that the Android system itself does not check for matching feature support on the device before installing an application." I found another post with an example on how to perform a check to see if the camera exists. I will end up implementing something like this and display a message to the user if their device does not have a camera. – boundandbleeding Jan 27 '12 at 14:57
  • 2
    Get the same error, but have an emulated device with camera and sdcard. It's also not a tablet. Get the error on devices with API 7 & 8. Any tips? – James Cameron May 14 '13 at 12:14