Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
根据文档,当我在 LoaderManager 上调用 restartLoader 时,Bundle 将交付给我的加载器。有人会展示我如何阅读装载机一侧的那个捆绑包吗?我听说过构造函数,但我还没有看到它。一个非常短的代码片段就足够了。
我认为它提供了一个调用,onCreateLoader以便您可以像使用捆绑包一样使用它,例如将它传递给您的 Loader 实现的构造函数。
onCreateLoader
@Override public Loader<List<MyItem>> onCreateLoader(int id, Bundle args){ MyLoaderTask task = new MyLoaderTask(getActivity(),args); return task; }