Fix app crash for cached images

This commit is contained in:
David Development 2016-01-20 17:39:22 +01:00
parent b1f350468c
commit ada31cf4b7

View file

@ -98,12 +98,16 @@ public class NewsDetailImageDialogFragment extends DialogFragment {
//Build the menu
switch(mDialogType) {
case IMAGE:
if(mImageUrl.toString().startsWith("http")) { //Only allow download for http[s] images (prevent download of cached images)
mMenuItems.put(getString(R.string.action_img_download), new MenuActionLongClick() {
@Override
public void execute() {
downloadImage(mImageUrl);
}
public void executeLongClick() { changeDownloadDir(); }
public void executeLongClick() {
changeDownloadDir();
}
});
mMenuItems.put(getString(R.string.action_img_open), new MenuAction() {
@Override
@ -123,6 +127,9 @@ public class NewsDetailImageDialogFragment extends DialogFragment {
copyToClipboard(mDialogTitle, mImageUrl.toString());
}
});
} else {
mDialogTitle = "Cached image";
}
break;
case URL:
mMenuItems.put(getString(R.string.action_link_open), new MenuAction() {