diff --git a/app/src/main/java/ai/elimu/content_provider/ui/image/ImagesFragment.java b/app/src/main/java/ai/elimu/content_provider/ui/image/ImagesFragment.java index 79e51ce..a3d9f3e 100644 --- a/app/src/main/java/ai/elimu/content_provider/ui/image/ImagesFragment.java +++ b/app/src/main/java/ai/elimu/content_provider/ui/image/ImagesFragment.java @@ -147,7 +147,9 @@ public void run() { if (!imageFile.exists()) { // Download file bytes BaseApplication baseApplication = (BaseApplication) getActivity().getApplication(); - String downloadUrl = baseApplication.getBaseUrl() + imageGson.getBytesUrl(); + String downloadUrl = imageGson.getBytesUrl().startsWith("http") + ? imageGson.getBytesUrl() + : baseApplication.getBaseUrl() + imageGson.getBytesUrl(); Log.i(getClass().getName(), "downloadUrl: " + downloadUrl); byte[] bytes = MultimediaDownloader.downloadFileBytes(downloadUrl); Log.i(getClass().getName(), "bytes.length: " + bytes.length);