ActivityNotFoundException,图像捕获? [英] ActivityNotFoundException, image capturing?

查看:113
本文介绍了ActivityNotFoundException,图像捕获?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发布了一个应用程序,用户可以在其中拍照.我这样做是为了捕获照片:

I have released an App which user can take photo in it.I do this to capturing photo:

File file = new File( _path );
Uri outputFileUri = Uri.fromFile( file );   
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE );
intent.putExtra( MediaStore.EXTRA_OUTPUT, outputFileUri );      
startActivityForResult( intent, 0 );

我还添加了此权限以显示:

and also I added this permission to manifest:

<uses-permission android:name="android.permission.CAMERA" />

我在Android2.3.5Android3.0上测试了我的App,它运行正常.但是当我在Android4.0.3上运行我的App时,它崩溃了:

I tested my App on Android2.3.5 and Android3.0,and it works fine.But when I run my App on Android4.0.3,it crashes:

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.media.action.IMAGE_CAPTURE (has extras) }

我该如何解决这个问题?

How I can solve this problem?

推荐答案

可能会发生几件事

  1. 设备中可能没有相机
  2. 设备中没有SD卡

您的案件符合上述任何条件吗?

does your case meet any of the above?

这篇关于ActivityNotFoundException,图像捕获?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆