[英]Reading JPEG from Android Internal Storage
I have this code: 我有以下代码:
String imgPath = context.getFilesDir() + Constants.FILE_PATH + File.separator + customizer.getWallpaperPath();
Bitmap bmp = BitmapFactory.decodeFile(imgPath);
helpdeskLogo.setImageBitmap(bmp);
But, I find correctly the path, go to line for 'decodeFile', but when I arrived at the line to set the image on 'helpdesklogo', the bmp value was null. 但是,我正确找到了路径,转到“ decodeFile”行,但是当我到达在“ helpdesklogo”上设置图像的行时,bmp值为空。 I'm trying a lot of hour with many solutions, my ideas were ended!
我花了很多时间尝试许多解决方案,但我的想法却完结了!
EDIT ( ...and solved ): 编辑 ( ...并解决 ):
I found the problem! 我发现了问题! I'm execute that code before setting content view, I'm leaving this question for each people having my same error.
我在设置内容视图之前执行了该代码,我将这个问题留给每个有我相同错误的人。
Thanks to all guys! 谢谢大家!
在清单文件中包含此权限:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.