摄像头活动没有发现? [英] Camera Activity not found?

查看:119
本文介绍了摄像头活动没有发现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经发布了一个应用程序,并在日志中,我得到这个消息几次

  android.content.ActivityNotFoundException:无活动来处理意图行事{= android.intent.action.MAIN PKG = com.android.camera}

我打电话相机这样

 最终意图mainCameraIntent =新意图();
mainCameraIntent.setPackage(com.android.camera);
mainCameraIntent.setAction(android.intent.action.MAIN);
startActivity(mainCameraIntent);

为什么我得到这个消息?在我的设备(2.3.3),它工作正常。我有2.1设备的问题之前,也使用ProGuard删除code块,但我不知道这是有关任何这些


解决方案

  

为什么我得到这个消息?


由于你不应该使用这个意图。并非所有的设备将具有 com.android.camera

I've released an app and in the logs, I'm getting this message several times

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.MAIN pkg=com.android.camera } 

I'm calling the camera like this

final Intent mainCameraIntent = new Intent();
mainCameraIntent.setPackage("com.android.camera");
mainCameraIntent.setAction("android.intent.action.MAIN");
startActivity(mainCameraIntent);

Why am getting this message? On my device (2.3.3), it works fine. I had issues with 2.1 devices before and also with proguard removing blocks of code, but I'm not sure if this is related to any of those

解决方案

Why am getting this message?

Because you should not be using this Intent. Not all devices will have com.android.camera.

这篇关于摄像头活动没有发现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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