// Path: app/src/main/java/com/yuqirong/koku/application/MyApplication.java
// public class MyApplication extends Application {
// 
//     private static Context context;
//     private static ThreadPoolExecutor executor;
//     private static final int CPU_COUNT = Runtime.getRuntime().availableProcessors();
//     private static final int CORE_POOL_SIZE = CPU_COUNT + 1;
//     private static final int MAXIMUM_POOL_SIZE = CPU_COUNT * 2 + 1;
//     private static final int KEEP_ALIVE = 1;
//     private static final BlockingQueue<Runnable> sPoolWorkQueue =
//             new LinkedBlockingQueue<Runnable>(128);
//     private static final ThreadFactory sThreadFactory = new ThreadFactory() {
//         private final AtomicInteger mCount = new AtomicInteger(1);
// 
//         public Thread newThread(Runnable r) {
//             return new Thread(r, "AsyncTask #" + mCount.getAndIncrement());
//         }
//     };
//     private static RequestQueue mQueue;
// 
//     /**
//      * 得到volley队列
//      * @return
//      */
//     public static RequestQueue getRequestQueue() {
//             return mQueue;
//     }
// 
//     public static Context getContext() {
//         return context;
//     }
// 
//     public static ThreadPoolExecutor getExecutor() {
//         return executor;
//     }
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         context = this;
//         ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this)
//                 .threadPriority(Thread.NORM_PRIORITY - 1).denyCacheImageMultipleSizesInMemory()
//                 .memoryCache(new LruMemoryCache(2 * 1024 * 1024)).memoryCacheSize(2 * 1024 * 1024)
//                 .diskCacheFileNameGenerator(new Md5FileNameGenerator()).diskCacheSize(50 * 1024 * 1024)
//                 .diskCacheFileCount(300).tasksProcessingOrder(QueueProcessingType.LIFO)
//                 .build();
//         ImageLoader.getInstance().init(config);
//         executor = new ThreadPoolExecutor(CORE_POOL_SIZE, MAXIMUM_POOL_SIZE, KEEP_ALIVE,
//                 TimeUnit.SECONDS, sPoolWorkQueue, sThreadFactory);
//         mQueue = Volley.newRequestQueue(context);
//     }
// 
// }


import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import com.yuqirong.koku.application.MyApplication;
package com.yuqirong.koku.fragment;



/**
 * Created by Anyway on 2015/8/28.
 */
public abstract class BaseFragment extends Fragment {

    public Context context;
    protected RequestQueue mQueue;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        context = getActivity();
// Path: app/src/main/java/com/yuqirong/koku/application/MyApplication.java
// public class MyApplication extends Application {
// 
//     private static Context context;
//     private static ThreadPoolExecutor executor;
//     private static final int CPU_COUNT = Runtime.getRuntime().availableProcessors();
//     private static final int CORE_POOL_SIZE = CPU_COUNT + 1;
//     private static final int MAXIMUM_POOL_SIZE = CPU_COUNT * 2 + 1;
//     private static final int KEEP_ALIVE = 1;
//     private static final BlockingQueue<Runnable> sPoolWorkQueue =
//             new LinkedBlockingQueue<Runnable>(128);
//     private static final ThreadFactory sThreadFactory = new ThreadFactory() {
//         private final AtomicInteger mCount = new AtomicInteger(1);
// 
//         public Thread newThread(Runnable r) {
//             return new Thread(r, "AsyncTask #" + mCount.getAndIncrement());
//         }
//     };
//     private static RequestQueue mQueue;
// 
//     /**
//      * 得到volley队列
//      * @return
//      */
//     public static RequestQueue getRequestQueue() {
//             return mQueue;
//     }
// 
//     public static Context getContext() {
//         return context;
//     }
// 
//     public static ThreadPoolExecutor getExecutor() {
//         return executor;
//     }
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         context = this;
//         ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this)
//                 .threadPriority(Thread.NORM_PRIORITY - 1).denyCacheImageMultipleSizesInMemory()
//                 .memoryCache(new LruMemoryCache(2 * 1024 * 1024)).memoryCacheSize(2 * 1024 * 1024)
//                 .diskCacheFileNameGenerator(new Md5FileNameGenerator()).diskCacheSize(50 * 1024 * 1024)
//                 .diskCacheFileCount(300).tasksProcessingOrder(QueueProcessingType.LIFO)
//                 .build();
//         ImageLoader.getInstance().init(config);
//         executor = new ThreadPoolExecutor(CORE_POOL_SIZE, MAXIMUM_POOL_SIZE, KEEP_ALIVE,
//                 TimeUnit.SECONDS, sPoolWorkQueue, sThreadFactory);
//         mQueue = Volley.newRequestQueue(context);
//     }
// 
// }


// Path: app/src/main/java/com/yuqirong/koku/fragment/BaseFragment.java
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import com.yuqirong.koku.application.MyApplication;

package com.yuqirong.koku.fragment;



/**
 * Created by Anyway on 2015/8/28.
 */
public abstract class BaseFragment extends Fragment {

    public Context context;
    protected RequestQueue mQueue;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        context = getActivity();
        mQueue = MyApplication.getRequestQueue();