summaryrefslogtreecommitdiff
path: root/src/org/fox/ttrss/OfflineDownloadService.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/fox/ttrss/OfflineDownloadService.java')
-rw-r--r--src/org/fox/ttrss/OfflineDownloadService.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/org/fox/ttrss/OfflineDownloadService.java b/src/org/fox/ttrss/OfflineDownloadService.java
index 489df927..ba5aba1f 100644
--- a/src/org/fox/ttrss/OfflineDownloadService.java
+++ b/src/org/fox/ttrss/OfflineDownloadService.java
@@ -75,6 +75,9 @@ public class OfflineDownloadService extends IntentService {
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
new Intent(this, MainActivity.class), 0);
+ notification.flags |= Notification.FLAG_ONGOING_EVENT;
+ notification.flags |= Notification.FLAG_ONLY_ALERT_ONCE;
+
notification.setLatestEventInfo(this, getString(R.string.notify_downloading_title), msg, contentIntent);
m_nmgr.notify(NOTIFY_DOWNLOADING, notification);
@@ -115,7 +118,7 @@ public class OfflineDownloadService extends IntentService {
intent.addCategory(Intent.CATEGORY_DEFAULT);
sendBroadcast(intent);
} else {
- updateNotification("Downloading images...");
+ updateNotification(getString(R.string.notify_downloading_images, 0));
}
m_readableDb.close();
@@ -140,6 +143,8 @@ public class OfflineDownloadService extends IntentService {
private void downloadArticles() {
Log.d(TAG, "offline: downloading articles... offset=" + m_articleOffset);
+ updateNotification(getString(R.string.notify_downloading_articles, m_articleOffset));
+
OfflineArticlesRequest req = new OfflineArticlesRequest(this);
@SuppressWarnings("serial")
@@ -195,8 +200,6 @@ public class OfflineDownloadService extends IntentService {
getWritableDb().execSQL("DELETE FROM articles;");
- updateNotification(R.string.notify_downloading_articles);
-
downloadArticles();
} catch (Exception e) {
e.printStackTrace();