From 3c078290bc99c1496bb42f3e687d183216c2274c Mon Sep 17 00:00:00 2001 From: David Development Date: Sat, 11 Apr 2015 14:04:57 +0200 Subject: [PATCH] Fix app crash on emulator --- .../services/DownloadImagesService.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/DownloadImagesService.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/DownloadImagesService.java index 989fff39..a62a8718 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/DownloadImagesService.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/services/DownloadImagesService.java @@ -83,12 +83,16 @@ public class DownloadImagesService extends IntentService { private void initService() { - pathToImageCache = FileUtils.getPathImageCache(this); + try { + pathToImageCache = FileUtils.getPathImageCache(this); - maxCount = 0; - if(random == null) - random = new Random(); - NOTIFICATION_ID = random.nextInt(); + maxCount = 0; + if (random == null) + random = new Random(); + NOTIFICATION_ID = random.nextInt(); + } catch (Exception ex) { + ex.printStackTrace(); + } } @Override