现在很多开发者在裁图的时候还是使用com.android.camera.action.CROP 来调用 startActivity()。 这不是个好主意。

任何不是依android开头的Action 名称都不是标准的。依 com.android 开头的只是Android 内部应用之间的私有Action。 比如这个裁图的是Android系统默认相机提供的功能,很多第三方Rom会替换系统的某一个App。

如果一个第三方Rom使用了自己的相机程序替代了系统默认的,并且没有提供com.android.camera.action.CROP 这个Action,则您的应用就会崩溃了。

所以当您需要裁图功能的时候,可以像我一样从Android 相机代码中摘出这部分代码,或者使用别人摘好的代码即可。

下面是一些不错的可用裁图项目:

值得注意的是,如果您在某些4.0手机上发现如下错误信息:
1
2
3
4
java.lang.UnsupportedOperationException
    at
android.view.GLES20Canvas.clipPath(GLES20Canvas.java:
413)
    at
com.android.camera.HighlightView.draw(HighlightView.java:
101)
    at
com.android.camera.CropImageView.onDraw(CropImage.java:
783)
这个是由于在4.0系统上默认启用了硬件加速,而这些手机上硬件加速后 不支持某些绘图函数导致的。 只需要关闭裁图Activity的硬件加速功能即可。在activity xml文件中设置
android:hardwareAccelerated=”false” 即可。

转载: http://blog.chengyunfeng.com/?p=476#ixzz31JgW5wVI

注意android裁图的Intent action的更多相关文章

  1. Android开发之常用Intent.Action【转】

    1.从google搜索内容 Intent intent = new Intent(); intent.setAction(Intent.ACTION_WEB_SEARCH); intent.putEx ...

  2. android intent和intent action大全

    1.Intent的用法:(1)用Action跳转1,使用Action跳转,如果有一个程序的AndroidManifest.xml中的某一个 Activity的IntentFilter段中 定义了包含了 ...

  3. (转)android.intent.action.MAIN与android.intent.category.LAUNCHER

    android.intent.action.MAIN决定应用程序最先启动的Activity android.intent.category.LAUNCHER决定应用程序是否显示在程序列表里 在网上看到 ...

  4. 理解android.intent.action.MAIN 与 android.intent.category.LAUNCHER

    刚才看了一下sundy的视频<LLY110426_Android应用程序启动>,里面讲到luncher这个activity通过获取应用程序信息来加载应用程序,显示给用户,其中就是通过一个应 ...

  5. 系统广播 android.intent.action.KILL_BACKGROUND_SERVICE

    Broadcast: Intent { act=android.intent.action.KILL_BACKGROUND_SERVICE.com.xxx.VoiceAssistant flg=0x1 ...

  6. android.intent.action.MAIN 与 android.intent.category.LAUNCHER 的验证理解 (转)

    原文地址:android.intent.action.MAIN 与 android.intent.category.LAUNCHER 的验证理解 作者: 第一种情况:有MAIN,无LAUNCHER,程 ...

  7. Android 广播大全 Intent Action 事件

    Intent.ACTION_AIRPLANE_MODE_CHANGED; //关闭或打开飞行模式时的广播 Intent.ACTION_BATTERY_CHANGED; //充电状态,或者电池的电量发生 ...

  8. 我的Android最佳实践之—— 常用的Intent.Action(转)

    1.从google搜索内容 Intent intent = new Intent(); intent.setAction(Intent.ACTION_WEB_SEARCH); intent.putEx ...

  9. 【转】Android Intent Action 大全

    String ADD_SHORTCUT_ACTION 动作:在系统中添加一个快捷方式.. “android.intent.action.ADD_SHORTCUT” String ALL_APPS_AC ...

随机推荐

  1. Android开发之显示通知

    Toast类可以用来显示消息给用户,虽然它很方便,但是有不能持久.它只是在屏幕上显示几秒后就自动消失掉了.对于重要的信息或消息,要使用更加持久的方法.这种情形下,就应当使用通知,即使用Notifica ...

  2. apache目录及文件讲解

    apache目录下bin,conf,htdocs,logs,modules讲解    bin:        ab  压力测试工具        apachectl  启动命令        apxs ...

  3. C# QRCode、DataMatrix和其他条形码的生成和解码软件

    今天制造了一个C#的软件,具体是用于生成二维码和条形码的,包括常用的QRCode.DataMatrix.Code128.EAN-8等等. 使用的第三方类库是Zxing.net和DataMatrix.n ...

  4. 在解决方案中添加Layout,Image文件夹

    在解决方案中添加文件夹如Layout,Image,可以使用映射的方式(右键该解决方案,添加对Layout的映射),这样IIS的地址和该文件夹就绑定了:拖该文件夹中的 文件时,显示的就是该文件在IIS中 ...

  5. o] TortoiseGit错误 - Could not get all refs. libgit2 returned: corrupted loose reference file

    因无法追溯的同步操作错误或工程文件错误,造成Git 同步时报错: Could not get all refs. libgit2 returned: corrupted loose reference ...

  6. android - android Couldn't load runtimecore_java from loader

    在写Arcgis Android 或百度Android的时候,有时会报诸如,java.lang.UnsatisfiedLinkError:android Couldn't load runtimeco ...

  7. 如何快速的将Centos6.7快速升级3.10.9

    参考文档:http://www.xiexianbin.cn/linux/2015/10/15/quickly-upgrade-centos6.5-kernel-from-2.6.32-to-3.10. ...

  8. LINQ 多条件写法

    源代码: string depAll = (ddl_dep1.SelectedValue == "") ? "" : ddl_dep1.SelectedValu ...

  9. 不知道的陷阱:C#委托和事件的困惑

    转载网址:http://www.cnblogs.com/buptzym/archive/2013/03/15/2962300.html 不知道的陷阱:C#委托和事件的困惑   一. 问题引入 通常,一 ...

  10. PHP发送AT指令

    需求: 发送短信到用户输入手机, 要求可以自定义信息内容 问题: 没有电信猫, 使用免费api接口无法自定义短信内容 解决方案: 通过4G网卡, 接在服务器上, 通过AT指令操作网卡, 发送短信 查阅 ...