+ final DictionaryInfo downloadable = application.getDownloadable(dictionaryInfo.uncompressedFilename);
+ if (downloadable != null) {
+ final MenuItem downloadMenuItem = menu.add(getString(R.string.downloadButton, downloadable.zipBytes/1024.0/1024.0));
+ downloadMenuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
+ @Override
+ public boolean onMenuItemClick(MenuItem item) {
+ final Intent intent = getDownloadIntent(downloadable);
+ startActivity(intent);
+ setListAdapter(adapter = new Adapter());
+ return true;
+ }
+
+ });
+ }
+
+ }
+
+ private Intent getDownloadIntent(final DictionaryInfo downloadable) {
+ final Intent intent = DownloadActivity.getLaunchIntent(downloadable.downloadUrl,
+ application.getPath(downloadable.uncompressedFilename).getPath() + ".zip",
+ downloadable.dictInfo);
+ return intent;