Back to project page MediaPicker.
The source code is released under:
Apache License
If you think the Android project MediaPicker 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.urza.mediapicker; /*ww w . ja v a 2s. c o m*/ import android.app.Application; import android.content.Context; import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator; import com.nostra13.universalimageloader.core.ImageLoader; import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; import com.nostra13.universalimageloader.core.assist.QueueProcessingType; /** * Created by urza on 19.7.2014. */ public class MultiPicker extends Application { /** * The fragment argument representing the item ID that this fragment * represents. */ public static final int IMAGE_LOADER = 1; public static final int VIDEO_LOADER = 2; public static final String SELECTION = "selection"; public static final String MEDIATYPE_CHOICE = "mediaType"; public static void initImageLoader(Context context) { // This configuration tuning is custom. You can tune every option, you may tune some of them, // or you can create default configuration by // ImageLoaderConfiguration.createDefault(this); // method. ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context) .threadPriority(Thread.NORM_PRIORITY - 2) .denyCacheImageMultipleSizesInMemory() .diskCacheFileNameGenerator(new Md5FileNameGenerator()) .diskCacheSize(50 * 1024 * 1024) // 50 Mb .tasksProcessingOrder(QueueProcessingType.LIFO) //.writeDebugLogs() // Remove for release app .build(); // Initialize ImageLoader with configuration. ImageLoader.getInstance().init(config); } public void onCreate() { super.onCreate(); initImageLoader(getApplicationContext()); } }