位置: 编程技术 - 正文

异步加载图片框架ImageLoader的使用(ios异步加载图片)

编辑:rootadmin

推荐整理分享异步加载图片框架ImageLoader的使用(ios异步加载图片),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:异步加载图片框怎么弄,异步加载页面,js异步加载图片,异步加载图片框怎么弄,异步加载图片框怎么弄,异步加载组件,异步加载图片框怎么设置,异步加载图片框怎么弄,内容如对您有帮助,希望把文章链接给更多的朋友!

异步加载图片框架ImageLoader的使用(ios异步加载图片)

转自: com.example.test.com; import java.io.File; import android.app.Activity; import android.os.Bundle; import android.view.ViewGroup; import android.view.Window; import android.widget.ImageView; import com.nostra.universalimageloader.cache.disc.impl.UnlimitedDiscCache; import com.nostra.universalimageloader.cache.disc.naming.HashCodeFileNameGenerator; import com.nostra.universalimageloader.cache.memory.impl.LruMemoryCache; import com.nostra.universalimageloader.core.DisplayImageOptions; import com.nostra.universalimageloader.core.ImageLoader; import com.nostra.universalimageloader.core.ImageLoaderConfiguration; import com.nostra.universalimageloader.core.assist.QueueProcessingType; import com.nostra.universalimageloader.core.decode.BaseImageDecoder; import com.nostra.universalimageloader.core.download.BaseImageDownloader; import com.nostra.universalimageloader.utils.StorageUtils; public class MainActivity extends Activity { private ImageLoader imageLoader = ImageLoader.getInstance(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); ViewGroup viewGroup = (ViewGroup) getLayoutInflater().inflate(R.layout.main, null); setContentView(viewGroup); getLayoutInflater(); //ImageView对象用于显示图片 ImageView imageView = (ImageView) findViewById(R.id.imageView1); loadImage(imageView); } private void loadImage(final ImageView imageView) { //图片保存系统路径 File cacheDir = StorageUtils.getOwnCacheDirectory(MainActivity.this, "data"); DisplayImageOptions imageOptions = new DisplayImageOptions.Builder().cacheInMemory().cacheOnDisc() .build(); //一些相关的设置 ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(MainActivity.this).threadPoolSize(5) .threadPriority(Thread.NORM_PRIORITY - 1).tasksProcessingOrder(QueueProcessingType.LIFO).denyCacheImageMultipleSizesInMemory() .memoryCache(new LruMemoryCache( * )).memoryCacheSize(1 * * ).discCache(new UnlimitedDiscCache(cacheDir)) // default .discCacheSize( * * ).discCacheFileCount().discCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default .imageDownloader(new BaseImageDownloader(MainActivity.this)) // default .imageDecoder(new BaseImageDecoder()) // default .defaultDisplayImageOptions(imageOptions) // default .enableLogging().build(); //初始化配置 imageLoader.init(config); //显示图片 imageLoader.displayImage(" imageView); } }

Unable to instantiate application io.rong.app.App: java.lang.ClassNotFoundException: -::.:E/ActivityThread():Unabletoinstantiateapplicationio.rong.app.App:java.lang.ClassNotFoundException:Didn'tfindclassio.rong.app.Apponpath:DexPathList[[zipfile/data/app/io.rong.app-

Android Studio如何Format代码 AndroidStudio如何Format代码在Eclipse中,我们一般使用CtrlShiftF来式化代码,AndroidStudio中需要换成:ReformatcodeCTRLALTL(Win)OPTIONCMDL(Mac)

【Android】FragmentTabHost实现底部Tab菜单选项 以前实现类微博底部菜单使用的是TabHostActivity来实现,但是使用的时候提醒已经被弃用,现在我们可以通过FragmentTabHostFragment来实现。下面就是demo:1.mai

本文链接地址:https://www.jiuchutong.com/biancheng/384263.html 转载请保留说明!

上一篇:开发技术前线 第十一期(技术开发类工作有哪些)

下一篇:Unable to instantiate application io.rong.app.App: java.lang.ClassNotFoundException:(unable to instantiate decoder)

免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

鄂ICP备2023003026号

网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

友情链接: 武汉网站建设 电脑维修 湖南楚通运网络