Пример #1
0
  @Override
  public void onDestroyView() {
    super.onDestroyView();

    if (mLibrary != null) {
      mLibrary.closeDatabase();
      mAdapters.clear();
    }
  }
Пример #2
0
        @Override
        public void OnLibraryDownloadFinished(DownloaderResult result) {
          mProgressDialog.dismiss();
          App.libraryDownloader = null;

          if (result.getResult() == DownloadResult.SUCCESSFUL) {
            if (mLibrary != null) {
              mLibrary.closeDatabase();
            }
            mLibrary = new MyLibrary(getActivity());
            mLibrary.openDatabase();
            LibraryAdapter a =
                new LibraryAdapter(
                    getActivity(), mLibrary.getArtists(), mLibrary, MyLibrary.LVL_ARTIST);
            mAdapters.add(a);
            showList();
          } else {
            Utilities.ShowMessageDialog(
                getActivity(), R.string.library_download_error, result.getMessageId());
          }
        }