Android 找不到摄像头活动?
我发布了一个应用程序,在日志中,我多次收到此消息Android 找不到摄像头活动?,android,camera,Android,Camera,我发布了一个应用程序,在日志中,我多次收到此消息 android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.MAIN pkg=com.android.camera } 我这样叫摄像机 final Intent mainCameraIntent = new Intent(); mainCameraIntent.setPackage("com.
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.MAIN pkg=com.android.camera }
我这样叫摄像机
final Intent mainCameraIntent = new Intent();
mainCameraIntent.setPackage("com.android.camera");
mainCameraIntent.setAction("android.intent.action.MAIN");
startActivity(mainCameraIntent);
为什么我会收到这个信息?在我的设备(2.3.3)上,它工作正常。我以前在2.1设备上遇到过问题,也在proguard删除代码块时遇到过问题,但我不确定这是否与这些问题有关
为什么我会收到这个信息
因为您不应该使用此
意图
。并非所有的设备都会有com.android.camera
你能建议一种启动设备摄像头应用程序的替代方法吗?@bizso09:你可以使用MediaStore拍照。操作\u IMAGE\u CAPTURE
:我只想启动摄像头应用程序,让用户拍摄他想要的任意多张照片。我不想处理结果。这还可能吗?@bizso09:没有通用的Intent
,就像没有通用的Intent
打开计算器一样。