Automated import from //branches/donutburger/...@141664,141664

This commit is contained in:
Romain Guy 2009-03-24 20:42:40 -07:00 committed by The Android Open Source Project
parent c7fdae1763
commit c5aa56da9a
1 changed files with 7 additions and 1 deletions

View File

@ -90,7 +90,13 @@ public class LiveFolder extends Folder {
if (mLoadingTask != null && mLoadingTask.getStatus() == AsyncTask.Status.RUNNING) {
mLoadingTask.cancel(true);
}
((LiveFolderAdapter) mContent.getAdapter()).cleanup();
// The adapter can be null if onClose() is called before FolderLoadingTask
// is done querying the provider
final LiveFolderAdapter adapter = (LiveFolderAdapter) mContent.getAdapter();
if (adapter != null) {
adapter.cleanup();
}
}
static class FolderLoadingTask extends AsyncTask<LiveFolderInfo, Void, Cursor> {