3

I do exactly what this guy suggests which is exactly the same as the creator of the Universal Image Loader, but I still get this error:

URI = assets://NMF0002_007.jpg
resolveUri failed on bad bitmap uri: NMF0002_007.jpg

What should I look for to ensure that the images are recognised?

I use it like this:

//get the file name
String fileName = cursor.getString(cursor.getColumnIndexOrThrow(DatabaseHelper.FIELD_RESOURCE));
String imageUri = "assets://";
Log.d(TAG, "URI = " + imageUri + fileName);
ImageLoader.getInstance().displayImage(imageUri+fileName, holder.iv_details_resource);

This is my configuration:

//Get the imageloader.
ImageLoader imageLoader = ImageLoader.getInstance();

//Create image options.
DisplayImageOptions options = new DisplayImageOptions.Builder()
    .cacheOnDisc() 
    .imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2) 
    .bitmapConfig(Bitmap.Config.RGB_565)
    .build();

//Create a config with those options.
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())
    .defaultDisplayImageOptions(options)
    .discCacheExtraOptions(480, 800, CompressFormat.JPEG, 75)
    .build();

//Initialise the imageloader.
imageLoader.init(config);

What am I doing wrong or missing?

4

1 回答 1

1

解决方案 - 我在寻找 .jpg 而我的文件扩展名是 .JPG

如果 NOSTRA 可以发布一些聪明的东西以供留意,我会将您的回答标记为对我愚蠢的官方回答。

于 2013-08-05T13:23:46.587 回答