首页 > 代码库 > 今天扫描二维码时出现一个奇葩错误:java.lang.SecurityException: Unab

今天扫描二维码时出现一个奇葩错误:java.lang.SecurityException: Unab

后经多方查找,终于在stackoverflow中找到答案:http://stackoverflow.com/questions/18096607/using-crop-intent-getting-java-lang-securityexception-unable-to-find-app-for-ca

原文如下: 
This log means that your app is having trouble handling a communication intent. Sometimes problems like this can be cause by sending an intent with big extras. Try to reduce the dimension of the image or, and this is the best way, save your image on the sd and put in the extras only the Uri of that image

翻译:

意思是你在跳转activity的过程中携带的extras中有图片的Bitmap,应用尽量减少图片的尺寸大小,应该通过保存图片到sd卡中或者通过uri方式传递图片参数。

果然去掉了resultIntent.putExtra("bitmap", bitmap);这句后就不报错了。

 

由此可见,图片传递等大文件或者数据,不要用这种方式传递。

今天扫描二维码时出现一个奇葩错误:java.lang.SecurityException: Unab