我成功整合通用ImageLoader的在我的相冊應用從手機存儲安卓:通用圖像裝載機 - 添加新的圖像緩存
但新圖像(從攝像機/處理圖像捕捉)顯示圖像存儲在該應用的指定文件夾不會出現在圖庫中。即使應用程序重新啓動。
可能是因爲這個錯誤
W/ImageLoader: Try to initialize ImageLoader which had already been initialized before. To re-init ImageLoader with new configuration call ImageLoader.destroy() at first.
我想添加新的圖像緩存的細節將解決此問題。但不知道如何。請幫助
代碼:活動擴展應用
DisplayImageOptions defaultDisplayImageOptions = new DisplayImageOptions.Builder() //
.considerExifParams(true)
.resetViewBeforeLoading(true)
.showImageOnLoading(R.drawable.nophotos)
.showImageOnFail(R.drawable.nophotos)
.delayBeforeLoading(0)
.build(); //
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(
getApplicationContext())
.defaultDisplayImageOptions(defaultDisplayImageOptions)
.memoryCacheExtraOptions(480, 800).threadPoolSize(5)
.build();
ImageLoader.getInstance().init(config);
加載所有專輯
PhoneMediaControl mediaControl = new PhoneMediaControl();
mediaControl.setLoadalbumphoto(new loadAlbumPhoto() {
@Override
public void loadPhoto(ArrayList<AlbumEntry> albumsSorted_) {
albumsSorted = new ArrayList<PhoneMediaControl.AlbumEntry>(albumsSorted_);
if (mView != null && mView.getEmptyView() == null) {
mView.setEmptyView(null);
}
if (listAdapter != null) {
listAdapter.notifyDataSetChanged();
}
}
});
mediaControl.loadGalleryPhotosAlbums(mContext, 0);
有沒有什麼辦法來新處理的圖像添加到緩存中或已經啓動的圖像加載器
先生,我需要添加新的處理過的圖像已經啓動的圖像加載器..是否有可能 –
你意味着你從相機得到一張照片,你也希望它緩存在通用圖像加載器的權利? –
是的...我將新圖像保存到應用程序文件夾..需要添加到緩存 –