Back to project page UniversalImagePick.
The source code is released under:
Apache License
If you think the Android project UniversalImagePick listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.luffyjet.universalimagepick; /* w w w .ja va2 s .c om*/ import android.app.Application; import android.content.Context; import android.graphics.Bitmap; import com.nostra13.universalimageloader.core.DisplayImageOptions; import com.nostra13.universalimageloader.core.ImageLoader; import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; import com.nostra13.universalimageloader.core.assist.ImageScaleType; public class App extends Application { @Override public void onCreate() { super.onCreate(); initImageLoader(this); } public static void initImageLoader(Context context) { ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context) // .memoryCacheExtraOptions(480, 800) // default = device screen dimensions .diskCacheExtraOptions(480, 800, null) .threadPriority(Thread.NORM_PRIORITY - 2) .denyCacheImageMultipleSizesInMemory() .threadPoolSize(3) // .memoryCache(new WeakMemoryCache()) // .writeDebugLogs() // Remove for release app .build(); // Initialize ImageLoader with configuration. ImageLoader.getInstance().init(config); } public static interface ImgLoaderOpts { DisplayImageOptions forImgSelect = new DisplayImageOptions.Builder() // .showImageOnLoading(R.drawable.default_img)// loading? // .showImageForEmptyUri(R.drawable.qb_group_open_troop_activity_break) // .showImageOnFail(R.drawable.qb_group_open_troop_activity_break) .resetViewBeforeLoading(false) .cacheInMemory(true) .cacheOnDisk(true) .considerExifParams(true) .imageScaleType(ImageScaleType.EXACTLY) // .decodingOptions(options) .bitmapConfig(Bitmap.Config.RGB_565) .build(); } }