Search code examples
androidvideo-recording

ActivityNotFoundException wnen using Camcorder.(android.media.action.VIDEO_CAMERA )


I want to implement VideoRecording function. I have the below code,but it throws me this error. How can I rectify it.

Here is my code,

        Intent cameraIntent = new Intent(MediaStore.INTENT_ACTION_VIDEO_CAMERA);
        cameraIntent.putExtra("android.intent.extra.durationLimit", 30);
           startActivityForResult(cameraIntent,TAKE_PICTURE_WITH_CAMERA);

Logcat Details

07-28 11:59:22.271: ERROR/AndroidRuntime(5590): Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.media.action.VIDEO_CAMERA (has extras) }
07-28 11:59:22.271: ERROR/AndroidRuntime(5590):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)
07-28 11:59:22.271: ERROR/AndroidRuntime(5590):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
07-28 11:59:22.271: ERROR/AndroidRuntime(5590):     at android.app.Activity.startActivityForResult(Activity.java:2817)

Solution

  • Which API level you are using? bcoz android.intent.extra.durationLimit will work from API level 8 on-wards.

    From the Android ref doc: http://developer.android.com/reference/android/provider/MediaStore.html

    public static final String EXTRA_DURATION_LIMIT

    Since: API Level 8 Specify the maximum allowed recording duration in seconds. Constant Value: "android.intent.extra.durationLimit"

    I suspect that could be the problem!!