Java Code Examples for android.support.v4.app.fragmentactivity#getSupportLoaderManager()

The following examples show how to use android.support.v4.app.fragmentactivity#getSupportLoaderManager() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ImageDataSource.java    From imsdk-android with MIT License 5 votes vote down vote up
/**
 * @param activity       用于初始化LoaderManager,需要兼容到2.3
 * @param path           指定扫描的文件夹目录,可以为 null,表示扫描所有图片
 * @param loadedListener 图片加载完成的监听
 */
public ImageDataSource(FragmentActivity activity, String path, OnImagesLoadedListener loadedListener) {
    this.activity = activity;
    this.loadedListener = loadedListener;

    LoaderManager loaderManager = activity.getSupportLoaderManager();
    if (path == null) {
        loaderManager.initLoader(LOADER_ALL, null, this);//加载所有的图片
    } else {
        //加载指定目录的图片
        Bundle bundle = new Bundle();
        bundle.putString("path", path);
        loaderManager.initLoader(LOADER_CATEGORY, bundle, this);
    }
}
 
Example 2
Source File: ImageDataSourceForRecommend.java    From imsdk-android with MIT License 5 votes vote down vote up
/**
 * @param activity       用于初始化LoaderManager,需要兼容到2.3
 * @param path           指定扫描的文件夹目录,可以为 null,表示扫描所有图片
 * @param loadedListener 图片加载完成的监听
 */
public ImageDataSourceForRecommend(FragmentActivity activity, String path, OnImagesLoadedListener loadedListener) {
    this.activity = activity;
    this.loadedListener = loadedListener;

    LoaderManager loaderManager = activity.getSupportLoaderManager();
    if (path == null) {
        loaderManager.initLoader(LOADER_ALL, null, this);//加载所有的图片
    } else {
        //加载指定目录的图片
        Bundle bundle = new Bundle();
        bundle.putString("path", path);
        loaderManager.initLoader(LOADER_CATEGORY, bundle, this);
    }
}
 
Example 3
Source File: ImageDataSource.java    From o2oa with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * @param activity       用于初始化LoaderManager,需要兼容到2.3
 * @param path           指定扫描的文件夹目录,可以为 null,表示扫描所有图片
 * @param loadedListener 图片加载完成的监听
 */
public ImageDataSource(FragmentActivity activity, String path, OnImagesLoadedListener loadedListener) {
    this.activity = activity;
    this.loadedListener = loadedListener;

    LoaderManager loaderManager = activity.getSupportLoaderManager();
    if (path == null) {
        loaderManager.initLoader(LOADER_ALL, null, this);//加载所有的图片
    } else {
        //加载指定目录的图片
        Bundle bundle = new Bundle();
        bundle.putString("path", path);
        loaderManager.initLoader(LOADER_CATEGORY, bundle, this);
    }
}
 
Example 4
Source File: VMPickScanPicture.java    From VMLibrary with Apache License 2.0 5 votes vote down vote up
/**
 * @param activity 用于初始化LoaderManager,需要兼容到2.3
 * @param path     指定扫描的文件夹目录,可以为 null,表示扫描所有图片
 * @param listener 图片加载完成的回调接口
 */
public VMPickScanPicture(FragmentActivity activity, String path, OnScanPictureListener listener) {
    this.activity = activity;
    this.mPictureListener = listener;

    LoaderManager loaderManager = activity.getSupportLoaderManager();
    if (path == null) {
        loaderManager.initLoader(LOADER_ALL, null, this);//加载所有的图片
    } else {
        //加载指定目录的图片
        Bundle bundle = new Bundle();
        bundle.putString("path", path);
        loaderManager.initLoader(LOADER_CATEGORY, bundle, this);
    }
}
 
Example 5
Source File: ImageDataSource.java    From ImagePicker with Apache License 2.0 5 votes vote down vote up
/**
 * @param activity       用于初始化LoaderManager,需要兼容到2.3
 * @param path           指定扫描的文件夹目录,可以为 null,表示扫描所有图片
 * @param loadedListener 图片加载完成的监听
 */
public ImageDataSource(FragmentActivity activity, String path, OnImagesLoadedListener loadedListener) {
    this.activity = activity;
    this.loadedListener = loadedListener;

    LoaderManager loaderManager = activity.getSupportLoaderManager();
    if (path == null) {
        loaderManager.initLoader(LOADER_ALL, null, this);//加载所有的图片
    } else {
        //加载指定目录的图片
        Bundle bundle = new Bundle();
        bundle.putString("path", path);
        loaderManager.initLoader(LOADER_CATEGORY, bundle, this);
    }
}
 
Example 6
Source File: CursorDataSource.java    From NIM_Android_UIKit with MIT License 5 votes vote down vote up
/**
 * @param activity 用于初始化LoaderManager,需要兼容到2.3
 * @param path     指定扫描的文件夹目录,可以为 null,表示扫描所有图片
 */
CursorDataSource(FragmentActivity activity, String path) {
    this.activity = activity;

    LoaderManager loaderManager = activity.getSupportLoaderManager();
    if (path == null) {
        // 加载所有的图片
        loader = loaderManager.initLoader(getId(LOADER_ALL), null, this);
    } else {
        // 加载指定目录的图片
        Bundle bundle = new Bundle();
        bundle.putString("path", path);
        loader = loaderManager.initLoader(getId(LOADER_CATEGORY), bundle, this);
    }
}
 
Example 7
Source File: LoaderManagerCreator.java    From android-atleap with Apache License 2.0 5 votes vote down vote up
/**
 * Init Loader Manager for Activity
 * @param activity activity
 * @param callbacks callbacks
 * @param args arguments for loader construction
 * @param <T>
 */
public <T> LoaderManagerCreator(FragmentActivity activity, LoaderManager.LoaderCallbacks<T> callbacks, Bundle args) {
    this(
            activity.getApplicationContext(),
            activity.getSupportLoaderManager(),
            (int) HashUtil.longHash(((Object) activity).getClass(), activity.getIntent(), callbacks),
            callbacks,
            args
    );
}
 
Example 8
Source File: EssMediaCollection.java    From FilePicker with MIT License 4 votes vote down vote up
public void onCreate(@NonNull FragmentActivity context, @NonNull EssMediaCallbacks callbacks) {
    mContext = new WeakReference<Context>(context);
    mLoaderManager = context.getSupportLoaderManager();
    mCallbacks = callbacks;
}
 
Example 9
Source File: EssAlbumCollection.java    From FilePicker with MIT License 4 votes vote down vote up
public void onCreate(@NonNull FragmentActivity context, @NonNull EssAlbumCallbacks callbacks) {
    mContext = new WeakReference<Context>(context);
    mLoaderManager = context.getSupportLoaderManager();
    mCallbacks = callbacks;
}
 
Example 10
Source File: EssMimeTypeCollection.java    From FilePicker with MIT License 4 votes vote down vote up
public void onCreate(@NonNull FragmentActivity context, @NonNull EssMimeTypeCallbacks callbacks) {
    mContext = new WeakReference<Context>(context);
    mLoaderManager = context.getSupportLoaderManager();
    mCallbacks = callbacks;
}
 
Example 11
Source File: EssMediaCollection.java    From AndroidDownload with Apache License 2.0 4 votes vote down vote up
public void onCreate(@NonNull FragmentActivity context, @NonNull EssMediaCallbacks callbacks) {
    mContext = new WeakReference<Context>(context);
    mLoaderManager = context.getSupportLoaderManager();
    mCallbacks = callbacks;
}
 
Example 12
Source File: EssAlbumCollection.java    From AndroidDownload with Apache License 2.0 4 votes vote down vote up
public void onCreate(@NonNull FragmentActivity context, @NonNull EssAlbumCallbacks callbacks) {
    mContext = new WeakReference<Context>(context);
    mLoaderManager = context.getSupportLoaderManager();
    mCallbacks = callbacks;
}
 
Example 13
Source File: EssMimeTypeCollection.java    From AndroidDownload with Apache License 2.0 4 votes vote down vote up
public void onCreate(@NonNull FragmentActivity context, @NonNull EssMimeTypeCallbacks callbacks) {
    mContext = new WeakReference<Context>(context);
    mLoaderManager = context.getSupportLoaderManager();
    mCallbacks = callbacks;
}
 
Example 14
Source File: AlbumMediaCollection.java    From AlbumCameraRecorder with MIT License 4 votes vote down vote up
public void onCreate(@NonNull FragmentActivity context, @NonNull AlbumMediaCallbacks callbacks) {
    mContext = new WeakReference<>(context);
    mLoaderManager = context.getSupportLoaderManager();
    mCallbacks = callbacks;
}
 
Example 15
Source File: AlbumMediaCollection.java    From Matisse with Apache License 2.0 4 votes vote down vote up
public void onCreate(@NonNull FragmentActivity context, @NonNull AlbumMediaCallbacks callbacks) {
    mContext = new WeakReference<Context>(context);
    mLoaderManager = context.getSupportLoaderManager();
    mCallbacks = callbacks;
}
 
Example 16
Source File: AlbumCollection.java    From Matisse with Apache License 2.0 4 votes vote down vote up
public void onCreate(FragmentActivity activity, AlbumCallbacks callbacks) {
    mContext = new WeakReference<Context>(activity);
    mLoaderManager = activity.getSupportLoaderManager();
    mCallbacks = callbacks;
}