无法找到Android的com.android.camera.CropImage活动 [英] unable to find com.android.camera.CropImage activity in android

查看:657
本文介绍了无法找到Android的com.android.camera.CropImage活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从下面的链接中运行照片流样品

  

<一个href="http://android-developers.blogspot.com/2008/09/android-photostream.html">http://android-developers.blogspot.com/2008/09/android-photostream.html

但是,当我尝试设置的图像(引用类ViewPhotoActivity.java)壁纸我收到以下错误

  android.content.ActivityNotFoundException:
 

     

找不到明确的活动类   {com.android.camera/com.android.camera.CropImage};   有你在宣布本次活动   你的Andr​​oidManifest.xml?

和我想下面的code引起的问题

 最终意向意图=新的意图(com.android.camera.action.CROP);
intent.setClassName(com.android.camera,com.android.camera.CropImage);
intent.setData(Uri.fromFile(MFILE));
intent.putExtra(outputX,宽度);
intent.putExtra(outputY,高度);
intent.putExtra(aspectX,宽度);
intent.putExtra(aspectY,高度);
intent.putExtra(规模化,真正的);
intent.putExtra(noFaceDetection,真正的);
intent.putExtra(输出,Uri.parse(文件:/+ mFile.getAbsolutePath()));
startActivityForResult(意向,REQUEST_CROP_IMAGE);
 

正如我试图找到这个问题的解决方案,但没有得到任何。

解决方案

我遵循LogCat中,而我是裁剪接触式图像发现了一种方法。它呼吁意图与下列参数:

  CMP = com.android.gallery / com.android.camera.CropImage
 

于是尝试用 com.android.gallery 替换 com.android.camera 。这为我工作:

 意向意图=新的意图(com.android.camera.action.CROP);
intent.setClassName(com.android.gallery,com.android.camera.CropImage);
 

在一些Android版本,包括最新,com.android.gallery不存在了。 您需要使用这个话:

 意向意图=新的意图(com.android.camera.action.CROP);
intent.setClassName(com.google.android.gallery3d,com.android.gallery3d.app.CropImage);
 

I am trying to run PhotoStream sample from following link

http://android-developers.blogspot.com/2008/09/android-photostream.html

But when i try to set the wallpaper of an image ( reference class ViewPhotoActivity.java) i am getting following error

android.content.ActivityNotFoundException:

Unable to find explicit activity class {com.android.camera/com.android.camera.CropImage}; have you declared this activity in your AndroidManifest.xml?

and i think the following code is causing the problem

final Intent intent = new Intent("com.android.camera.action.CROP");
intent.setClassName("com.android.camera", "com.android.camera.CropImage");
intent.setData(Uri.fromFile(mFile));
intent.putExtra("outputX", width);
intent.putExtra("outputY", height);
intent.putExtra("aspectX", width);
intent.putExtra("aspectY", height);
intent.putExtra("scale", true);
intent.putExtra("noFaceDetection", true);
intent.putExtra("output", Uri.parse("file:/" + mFile.getAbsolutePath()));
startActivityForResult(intent, REQUEST_CROP_IMAGE);

As i tried to find the solution of this problem but didn't get any.

解决方案

I found a way by following the LogCat while i was cropping a contact Image. It called the Intent with following parameters:

cmp=com.android.gallery/com.android.camera.CropImage

So try to replace the com.android.camera with com.android.gallery. This worked for me:

Intent intent = new Intent("com.android.camera.action.CROP");
intent.setClassName("com.android.gallery", "com.android.camera.CropImage");

On some Android version, including the newest, com.android.gallery doesn't exist anymore. You need to use this then:

Intent intent = new Intent("com.android.camera.action.CROP");
intent.setClassName("com.google.android.gallery3d", "com.android.gallery3d.app.CropImage");

这篇关于无法找到Android的com.android.camera.CropImage活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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