use of org.kiwix.kiwixmobile.zim_manager.ZimManageActivity in project kiwix-android by kiwix.
the class LibraryFragment method downloadFile.
@Override
public void downloadFile(Book book) {
downloadingBooks.add(book);
if (libraryAdapter != null && faActivity != null && faActivity.searchView != null) {
libraryAdapter.getFilter().filter(faActivity.searchView.getQuery());
}
Toast.makeText(super.getActivity(), getString(R.string.download_started_library), Toast.LENGTH_LONG).show();
Intent service = new Intent(super.getActivity(), DownloadService.class);
service.putExtra(DownloadIntent.DOWNLOAD_URL_PARAMETER, book.getUrl());
service.putExtra(DownloadIntent.DOWNLOAD_ZIM_TITLE, book.getTitle());
service.putExtra(EXTRA_BOOK, book);
super.getActivity().startService(service);
mConnection = new DownloadServiceConnection();
super.getActivity().bindService(service, mConnection.downloadServiceInterface, Context.BIND_AUTO_CREATE);
ZimManageActivity manage = (ZimManageActivity) super.getActivity();
manage.displayDownloadInterface();
}
Aggregations