use of com.frostwire.android.gui.transfers.HttpSlideSearchResult in project frostwire by frostwire.
the class SearchFragment method startPromotionDownload.
public void startPromotionDownload(Slide slide) {
SearchResult sr;
switch(slide.method) {
case Slide.DOWNLOAD_METHOD_TORRENT:
sr = new TorrentPromotionSearchResult(slide);
break;
case Slide.DOWNLOAD_METHOD_HTTP:
sr = new HttpSlideSearchResult(slide);
break;
default:
sr = null;
break;
}
if (sr == null) {
// check if there is a URL available to open a web browser.
if (slide.clickURL != null) {
Intent i = new Intent("android.intent.action.VIEW", Uri.parse(slide.clickURL));
try {
getActivity().startActivity(i);
} catch (Throwable t) {
// some devices incredibly may have no apps to handle this intent.
}
}
return;
}
String stringDownloadingPromo;
try {
stringDownloadingPromo = getString(R.string.downloading_promotion, sr.getDisplayName());
} catch (Throwable e) {
stringDownloadingPromo = getString(R.string.azureus_manager_item_downloading);
}
startTransfer(sr, stringDownloadingPromo);
}
Aggregations