android.app.Activity.getLoaderManager()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(206)

本文整理了Java中android.app.Activity.getLoaderManager()方法的一些代码示例,展示了Activity.getLoaderManager()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Activity.getLoaderManager()方法的具体详情如下:
包路径:android.app.Activity
类名称:Activity
方法名:getLoaderManager

Activity.getLoaderManager介绍

暂无

代码示例

代码示例来源:origin: iqiyi/Neptune

@Override
public android.app.LoaderManager getLoaderManager() {
  return mOriginActivity.getLoaderManager();
}

代码示例来源:origin: stephanenicolas/toothpick

@Override
 public LoaderManager get() {
  return activity.getLoaderManager();
 }
}

代码示例来源:origin: com.uphyca/android-junit4-robolectric

/**
 * @return
 * @see android.app.Activity#getLoaderManager()
 */
public LoaderManager getLoaderManager() {
  return mActivity.getLoaderManager();
}

代码示例来源:origin: moonsharp/PhotoChooser

public static void getPhotoDirs(Activity activity, Bundle args, PhotoSearchCallback searchCallback) {
  activity.getLoaderManager().initLoader(0, args, new PhotoLoaderCallback(activity, searchCallback));
}

代码示例来源:origin: HelloChenJinJun/TestChat

public void getAllImageFolder(Activity activity, final OnImageLoadListener listener) {
    this.activity = activity;
    imageFolderList = new ArrayList<>();
    LoaderManager loaderManager = activity.getLoaderManager();
    loaderManager.initLoader(LoadPictureUtil.LOAD_ALL, null, new LoaderManager.LoaderCallbacks<Cursor>() {
        @Override

代码示例来源:origin: novoda/sqlite-analyzer

private void retrieveShopsFromDatabase() {
  getActivity().getLoaderManager()
      .initLoader(R.id.loader_shop, null, new LoaderManager.LoaderCallbacks<Cursor>() {
        @Override
        public Loader<Cursor> onCreateLoader(int i, Bundle bundle) {
          return new ShopCursorLoader(getActivity());
        }
        @Override
        public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor cursor) {
          if (!cursor.moveToFirst()) {
            Log.d("demo", "Nothing in DB, returning early");
          }
          do {
            Log.d("demo", "Found shop: " + DB.Shop.getName(cursor));
            Log.d("demo", "Found postcode: " + DB.Shop.getPostcode(cursor));
          } while (cursor.moveToNext());
        }
        @Override
        public void onLoaderReset(Loader<Cursor> cursorLoader) {
        }
      });
}

代码示例来源:origin: com.albedinsky.android/database

/**
 * Called to perform initialization of the new instance of this adapter.
 *
 * @param activity The activity used to instantiate loader assistant.
 */
private void init(Activity activity) {
  this.mLoaderAssistant = new DataLoaderAdapterAssistant<>(activity, activity.getLoaderManager());
  this.mLoaderAssistant.attachAdapter(this);
  if (mAnnotationHandler != null) {
    this.mLoaderId = ((LoaderSpinnerAdapterAnnotationHandler) mAnnotationHandler).getLoaderId(mLoaderId);
  }
}

代码示例来源:origin: com.albedinsky.android/database

/**
 * Called to perform initialization of the new instance of this adapter.
 *
 * @param activity The activity used to instantiate loader assistant.
 */
private void init(Activity activity) {
  this.mLoaderAssistant = new DataLoaderAdapterAssistant<>(activity, activity.getLoaderManager());
  this.mLoaderAssistant.attachAdapter(this);
  if (mAnnotationHandler != null) {
    this.mLoaderId = ((LoaderAdapterAnnotationHandler) mAnnotationHandler).getLoaderId(mLoaderId);
  }
}

代码示例来源:origin: com.albedinsky.android/database

/**
 * Called to perform initialization of the new instance of this adapter.
 *
 * @param activity The activity used to instantiate loader assistant.
 */
private void init(Activity activity) {
  this.mLoaderAssistant = new DataLoaderAdapterAssistant<>(activity, activity.getLoaderManager());
  this.mLoaderAssistant.attachAdapter(this);
  if (mAnnotationHandler != null) {
    this.mLoaderId = ((LoaderAdapterAnnotationHandler) mAnnotationHandler).getLoaderId(mLoaderId);
  }
}

代码示例来源:origin: com.albedinsky.android/database

/**
 * Called to perform initialization of the new instance of this adapter.
 *
 * @param activity The activity used to instantiate loader assistant.
 */
private void init(Activity activity) {
  this.mLoaderAssistant = new DataLoaderAdapterAssistant<>(activity, activity.getLoaderManager());
  this.mLoaderAssistant.attachAdapter(this);
  if (mAnnotationHandler != null) {
    this.mLoaderId = ((LoaderAdapterAnnotationHandler) mAnnotationHandler).getLoaderId(mLoaderId);
  }
}

代码示例来源:origin: stackoverflow.com

public static void initEmptyLoaders(Activity activity, int... ids) {
  initEmptyLoaders(activity, activity.getLoaderManager(), ids);
}

public static void initEmptyLoaders(final Context ctx, LoaderManager loaderManager, int... ids) {
  LoaderManager.LoaderCallbacks callbacks = new LoaderManager.LoaderCallbacks() {
    @Override
    public Loader onCreateLoader(int i, Bundle bundle) {
      return new Loader(ctx);
    }

    @Override
    public void onLoadFinished(Loader loader, Object o) {
    }

    @Override
    public void onLoaderReset(Loader loader) {
    }
  };

  for (int id : ids) {
    loaderManager.initLoader(id, null, callbacks);
  }
}

代码示例来源:origin: openbmap/radiocells-scanner-android

/**
 * @link http://stackoverflow.com/questions/6317767/cant-add-a-headerview-to-a-listfragment
 *      Fragment lifecycle
 *      onAttach(Activity) called once the fragment is associated with its activity.
 *      onCreate(Bundle) called to do initial creation of the fragment.
 *      onCreateView(LayoutInflater, ViewGroup, Bundle) creates and returns the view hierarchy associated with the fragment.
 *      onActivityCreated(Bundle) tells the fragment that its activity has completed its own Activity.onCreate.
 *      onStart() makes the fragment visible to the user (based on its containing activity being started).
 *      onResume() makes the fragment interacting with the user (based on its containing activity being resumed).
 */
@Override
public final void onActivityCreated(final Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);
  this.getListView().addHeaderView(mHeader);
  // setup data
  initData();
  getActivity().getLoaderManager().initLoader(CELL_LOADER_ID, null, this);
}

代码示例来源:origin: openbmap/radiocells-scanner-android

@Override
public final void onActivityCreated(final Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);
  setHasOptionsMenu(true);
  this.getListView().addHeaderView(mHheader);
  registerForContextMenu(mHheader);
  initUi();
  // setup data
  initData();
  getActivity().getLoaderManager().initLoader(WIFI_LOADER_ID, null, this);
}

代码示例来源:origin: stackoverflow.com

this.loaderManager = activity.getLoaderManager();
this.callbackOne = new LoaderCallbackImpl(activity, new LoaderCallbackImpl.FinishedListener() {
  @Override

相关文章

Activity类方法