Fix app crash for cached images
This commit is contained in:
parent
b1f350468c
commit
ada31cf4b7
1 changed files with 32 additions and 25 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue