use*_*411 13 android imageview android-view android-bitmap
我正在寻找一个关于通过调用BitmapFactory.decodeFile引起的重复日志打印的解决方案.
在我的应用程序中,我ListView每秒钟都会重新绘制一个计时器.在ListView具有ImageView该获取是来自本地存储的图像源,(而不是从网络)
图像存储在:
filePath = /data/data/com.xxx.testlib/files/b22a1a294fd6e5ad3ea3d25b63c4c735.jpg
Run Code Online (Sandbox Code Playgroud)
我使用以下代码重绘图像,它工作正常.没有例外.
try
{
File filePath = context.getFileStreamPath(imageName);
if(filePath.exists()){
bMap = BitmapFactory.decodeFile(filePath.getPath());
}
}catch (Exception e)
{
e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)
但是在执行以下行时:
bMap = BitmapFactory.decodeFile(filePath.getPath());
Run Code Online (Sandbox Code Playgroud)
我在日志中得到如下打印:
03-07 09:55:29.100: I/System.out(32663): Not a DRM File, opening notmally
03-07 09:55:29.105: I/System.out(32663): buffer returned
....
Run Code Online (Sandbox Code Playgroud)
如何从打印到日志中读取.
谢谢你
编辑
每当执行此操作时,它也会滞后于手机.这种降低的性能特别明显,特别是当手机正在Waked up使用此代码返回活动时.
它已超过一年的OP,但仍未找到答案.如果有人找到解决方案,请发布.
谢谢.
小智 -1
希望,这可能对您有帮助。
当我尝试将相机捕获的图像直接保存到:/data/data/com.xxx.testlib/images/b22a1a294fd6e5ad3ea3d25b63c4c735.jpg时,我也遇到了同样的异常。
然后我首先将图像保存到相机使用的默认位置并将其复制到:/data/data/com.xxx.testlib/images/b22a1a294fd6e5ad3ea3d25b63c4c735.jpg。
现在“不是 DRM 文件,无法打开”已从日志中删除并成功保存图像。
结论:文件夹:-“/data/data/com.xxx.testlib/”是私有的,只能从应用程序内部访问。
| 归档时间: |
|
| 查看次数: |
5495 次 |
| 最近记录: |