Fix NullPointerException

initLoader will reuse the old loader associated with fragment.
But the fragment is destroyed. Use restartLoader which will
create another loader with new fragment.

Fixes: 143445993
Test: rebuild
Change-Id: I0a8a00ae94122f25d6d860b2512108ecd11d7806
This commit is contained in:
Raff Tsai
2019-10-29 13:25:56 +08:00
parent 29e21c096a
commit e223b33632

View File

@@ -128,7 +128,7 @@ public class StorageDashboardFragment extends DashboardFragment
getLoaderManager().restartLoader(STORAGE_JOB_ID, Bundle.EMPTY, this); getLoaderManager().restartLoader(STORAGE_JOB_ID, Bundle.EMPTY, this);
getLoaderManager() getLoaderManager()
.restartLoader(VOLUME_SIZE_JOB_ID, Bundle.EMPTY, new VolumeSizeCallbacks()); .restartLoader(VOLUME_SIZE_JOB_ID, Bundle.EMPTY, new VolumeSizeCallbacks());
getLoaderManager().initLoader(ICON_JOB_ID, Bundle.EMPTY, new IconLoaderCallbacks()); getLoaderManager().restartLoader(ICON_JOB_ID, Bundle.EMPTY, new IconLoaderCallbacks());
} }
@Override @Override