我已经发布了一个应用程序,在日志中,我多次收到此消息
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 删除代码块的问题,但我不确定这是否与其中任何一个有关
最佳答案
Why am getting this message?
因为你不应该使用这个Intent
。并非所有设备都有 com.android.camera
。
关于android - 找不到相机 Activity ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7885367/