@@ -0,0 +1,1980 @@
+package com.solide.imagelibs;%0A%0Aimport android.os.Bundle;%0Aimport android.support.v4.app.Fragment;%0Aimport android.support.v4.app.FragmentManager;%0A%0A/**%0A * A simple non-UI Fragment that stores a single Object and is retained over configuration changes.%0A * In this sample it will be used to retain the ImageCache object.%0A */%0Apublic class RetainFragment extends Fragment %7B%0A    private static final String TAG = RetainFragment.class.getName();%0A    private Object mObject;%0A%0A    /**%0A     * Empty constructor as per the Fragment documentation%0A     */%0A    public RetainFragment() %7B%7D%0A%0A    /**%0A     * Locate an existing instance of this Fragment or if not found, create and%0A     * add it using FragmentManager.%0A     *%0A     * @param fm The FragmentManager manager to use.%0A     * @return The existing instance of the Fragment or the new instance if just%0A     *         created.%0A     */%0A    public static RetainFragment findOrCreateRetainFragment(FragmentManager fm) %7B%0A        // Check to see if we have retained the worker fragment.%0A        RetainFragment mRetainFragment = (RetainFragment) fm.findFragmentByTag(TAG);%0A%0A        // If not retained (or first time running), we need to create and add it.%0A        if (mRetainFragment == null) %7B%0A            mRetainFragment = new RetainFragment();%0A            fm.beginTransaction().add(mRetainFragment, TAG).commitAllowingStateLoss();%0A        %7D%0A%0A        return mRetainFragment;%0A    %7D%0A%0A    @Override%0A    public void onCreate(Bundle savedInstanceState) %7B%0A        super.onCreate(savedInstanceState);%0A%0A        // Make sure this Fragment is retained over a configuration change%0A        setRetainInstance(true);%0A    %7D%0A%0A    /**%0A     * Store a single object in this Fragment.%0A     *%0A     * @param object The object to store%0A     */%0A    public void setObject(Object object) %7B%0A        mObject = object;%0A    %7D%0A%0A    /**%0A     * Get the stored object.%0A     *%0A     * @return The stored object%0A     */%0A    public Object getObject() %7B%0A        return mObject;%0A    %7D%0A%0A%7D%0A

Create RetainFragment.java