[英]using Android Universal Image Loader in acivity inside library project
i have problem on calling activity inside library 我在调用图书馆内部的活动时遇到问题
i use https://github.com/nostra13/Android-Universal-Image-Loader 我使用https://github.com/nostra13/Android-Universal-Image-Loader
inside activity in library project. 图书馆项目中的内部活动。 i setup it inside application class in main project that use library 我在使用库的主项目的应用程序类中设置它
https://github.com/nostra13/Android-Universal-Image- Loader/blob/master/sample/src/com/nostra13/example/universalimageloader/UILApplication.java https://github.com/nostra13/Android-Universal-Image- Loader / blob / master / sample / src / com / nostra13 / example / universalimageloader / UILApplication.java
but when i want use it in acitivity that are inside library return this error "ImageLoader must be init with configuration before using is the error from Illegal State Exception how can i solve it 但是,当我要在库中以活动方式使用它时,返回此错误“ ImageLoader必须在配置前进行初始化,然后使用是来自非法状态异常的错误,我该如何解决呢?
For your solution you need to use this 对于您的解决方案,您需要使用此
ImageLoader imgLoader = ImageLoader.getInstance();
imgLoader.init(ImageLoaderConfiguration.createDefault(YourActivityName.this));
options = new DisplayImageOptions.Builder().cacheInMemory(true)
.showImageOnLoading(R.drawable.placeholder)
.showImageOnFail(R.drawable.error).considerExifParams(true)
.build();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.